1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 function testCannotEmbedExtension(id) {
6 var done = chrome.test.callbackAdded();
7 var extensionoptions = document.createElement('extensionoptions');
8 extensionoptions.addEventListener('createfailed', function() {
9 document.body.removeChild(extensionoptions);
12 extensionoptions.addEventListener('load', function () {
13 document.body.removeChild(extensionoptions);
16 extensionoptions.setAttribute('extension', id);
17 document.body.appendChild(extensionoptions);
20 chrome.test.runTests([
21 function cannotEmbedInvalidExtensionId() {
22 testCannotEmbedExtension('thisisprobablynotrealextensionid');
25 function cannotEmbedSelfIfNoOptionsPage() {
26 testCannotEmbedExtension(chrome.runtime.id);