Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6026)

Unified Diff: chrome/test/data/extensions/api_test/extension_options/embed_invalid/test.js

Issue 429763002: Implement createfailed event for <extensionoptions> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove self hack Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/extension_options/embed_invalid/test.js
diff --git a/chrome/test/data/extensions/api_test/extension_options/embed_invalid/test.js b/chrome/test/data/extensions/api_test/extension_options/embed_invalid/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..fcf8f7dd037d126bff7bc5acc775ca3a8ece26c9
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/extension_options/embed_invalid/test.js
@@ -0,0 +1,28 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function testCannotEmbedExtension(id) {
+ var done = chrome.test.callbackAdded();
+ var extensionoptions = document.createElement('extensionoptions');
+ extensionoptions.addEventListener('createfailed', function() {
+ document.body.removeChild(extensionoptions);
+ done();
+ });
+ extensionoptions.addEventListener('load', function () {
+ document.body.removeChild(extensionoptions);
+ chrome.test.fail();
+ });
+ extensionoptions.setAttribute('extension', id);
+ document.body.appendChild(extensionoptions);
+}
+
+chrome.test.runTests([
+ function cannotEmbedInvalidExtensionId() {
+ testCannotEmbedExtension('thisisprobablynotrealextensionid');
+ },
+
+ function cannotEmbedSelfIfNoOptionsPage() {
+ testCannotEmbedExtension(chrome.runtime.id);
+ }
+]);

Powered by Google App Engine
This is Rietveld 408576698