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

Side by Side Diff: chrome/test/data/extensions/api_test/tabs/no_permissions/test.js

Issue 11824004: Do not pass URLs in onUpdated events to extensions unless they have the (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address review comments on tests Created 7 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/tabs/no_permissions/manifest.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 chrome.test.runTests([
6 function testOnUpdated() {
7 var expectedEventData = [{ status: 'loading' }, { status: 'complete' }];
8 var capturedEventData = [];
9
10 function onUpdateListener(tabId, info, tab) {
11 capturedEventData.push(info);
12 if (capturedEventData.length < expectedEventData.length) {
13 return;
14 }
not at google - send to devlin 2013/01/09 22:30:15 nit: single-line ifs omit {}
mvrable 2013/01/09 23:03:14 Done.
15 chrome.tabs.onUpdated.removeListener(onUpdateListener);
16 chrome.test.assertEq(expectedEventData, capturedEventData);
17 chrome.test.succeed();
18 }
19
20 chrome.tabs.onUpdated.addListener(onUpdateListener);
21 chrome.tabs.create({ url: 'chrome://newtab/' });
not at google - send to devlin 2013/01/09 22:30:15 mm, you should also test changing the URL or title
mvrable 2013/01/09 23:03:14 Done.
22 },
23
24 function testQuery() {
25 chrome.tabs.create({ url: 'chrome://newtab/' });
26 chrome.tabs.query({active: true}, chrome.test.callbackPass(function(tabs) {
27 chrome.test.assertEq(1, tabs.length);
28 chrome.test.assertEq(undefined, tabs[0].url);
not at google - send to devlin 2013/01/09 22:30:15 you could add the other sensitive properties here
mvrable 2013/01/09 23:03:14 Done (implemented as a separate check function so
29 }));
30 },
31
32 ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/tabs/no_permissions/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698