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

Side by Side Diff: chrome/test/data/extensions/api_test/executescript/run_at/test.js

Issue 9456037: Adding run_at to chrome.tabs.executeScript/insertCss. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2011 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.
4
5 var relativePath =
6 '/files/extensions/api_test/executescript/run_at/test.html';
7 var testUrl = 'http://b.com:PORT' + relativePath;
8 var firstEnter = true;
9
10 chrome.test.getConfig(function(config) {
11 testUrl = testUrl.replace(/PORT/, config.testServer.port);
12
13 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
14 if (changeInfo.status != 'complete')
15 return;
16 if (!firstEnter) {
Aaron Boodman 2012/03/28 01:04:16 Here's a cool trick: chrome.tabs.onUpdated.remove
eaugusti 2012/03/28 17:40:19 That is pretty cool. Done.
17 return;
18 }
19 firstEnter = false;
20
21 chrome.test.runTests([
22
Aaron Boodman 2012/03/28 01:04:16 no need for linebreak here
eaugusti 2012/03/28 17:40:19 Done.
23 function executeAtStartShouldSucceed() {
24 var script_file = {};
25 script_file.code = "document.title = 'Injected';";
26 chrome.tabs.executeScript(tabId, script_file, function() {
Aaron Boodman 2012/03/28 01:04:16 This doesn't seem to test the new feature at all.
eaugusti 2012/03/28 17:40:19 Wow, I can't believe I forgot to include the featu
27 chrome.tabs.get(tabId, chrome.test.callbackPass(function(tab) {
28 chrome.test.assertEq('Injected', tab.title);
29 }));
30 });
31 },
32 ]);
33 });
34
35 chrome.tabs.create({ url: testUrl });
36 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698