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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/tabs/no_permissions/test.js
diff --git a/chrome/test/data/extensions/api_test/tabs/no_permissions/test.js b/chrome/test/data/extensions/api_test/tabs/no_permissions/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..0a44adf930a847aeeacf253337820e4f35ad9105
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/tabs/no_permissions/test.js
@@ -0,0 +1,32 @@
+// Copyright (c) 2013 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.
+
+chrome.test.runTests([
+ function testOnUpdated() {
+ var expectedEventData = [{ status: 'loading' }, { status: 'complete' }];
+ var capturedEventData = [];
+
+ function onUpdateListener(tabId, info, tab) {
+ capturedEventData.push(info);
+ if (capturedEventData.length < expectedEventData.length) {
+ return;
+ }
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.
+ chrome.tabs.onUpdated.removeListener(onUpdateListener);
+ chrome.test.assertEq(expectedEventData, capturedEventData);
+ chrome.test.succeed();
+ }
+
+ chrome.tabs.onUpdated.addListener(onUpdateListener);
+ 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.
+ },
+
+ function testQuery() {
+ chrome.tabs.create({ url: 'chrome://newtab/' });
+ chrome.tabs.query({active: true}, chrome.test.callbackPass(function(tabs) {
+ chrome.test.assertEq(1, tabs.length);
+ 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
+ }));
+ },
+
+]);
« 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