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

Unified Diff: chrome/test/data/extensions/api_test/background_scripts/b.js

Issue 9150008: Introduce background.scripts feature for extension manifests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ready to land Created 8 years, 11 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/background_scripts/b.js
diff --git a/chrome/test/data/extensions/api_test/background_scripts/b.js b/chrome/test/data/extensions/api_test/background_scripts/b.js
new file mode 100644
index 0000000000000000000000000000000000000000..42717387df9490e3759a135b1c59d5a9bc3e97ac
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/background_scripts/b.js
@@ -0,0 +1,17 @@
+// Copyright (c) 2012 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.
+
+// We're just testing that multiple scripts get added to a page in-order
+// and are run.
+chrome.test.assertEq("hi!", test);
+
+// Also test the injection point is consistent. We want to inject into body
+// because having a document.body element is convenient for some scripts.
+var scripts = document.querySelectorAll("script");
+chrome.test.assertEq(2, scripts.length);
+for (var i = 0, script; script = scripts[i]; i++) {
+ chrome.test.assertEq("BODY", script.parentElement.nodeName);
+}
+
+chrome.test.notifyPass();

Powered by Google App Engine
This is Rietveld 408576698