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

Unified Diff: chrome/test/data/extensions/api_test/tabs/basics/query.js

Issue 569803004: Allow "url" to be an array of URL patterns (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update tabs.query documentation Created 6 years, 3 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/common/extensions/api/tabs.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/basics/query.js
diff --git a/chrome/test/data/extensions/api_test/tabs/basics/query.js b/chrome/test/data/extensions/api_test/tabs/basics/query.js
index f2ef5f5d3b7df3d4c3c0743e82ac5efd2094409c..173a2751bf5f7ace65b87ac96df64f5fb605b905 100644
--- a/chrome/test/data/extensions/api_test/tabs/basics/query.js
+++ b/chrome/test/data/extensions/api_test/tabs/basics/query.js
@@ -11,7 +11,7 @@ var active_and_window_tabs = [];
chrome.test.runTests([
function setup() {
- var tabs = ['http://example.org/a.html', 'http://google.com'];
+ var tabs = ['http://example.org/a.html', 'http://www.google.com/favicon.ico'];
chrome.windows.create({url: tabs}, pass(function(window) {
assertEq(2, window.tabs.length);
testWindowId = window.id;
@@ -125,6 +125,21 @@ chrome.test.runTests([
}));
},
+ function queryUrlAsArray() {
+ chrome.tabs.query({url: ["http://*.example.org/*"]}, pass(function(tabs) {
+ assertEq(1, tabs.length);
+ assertEq("http://example.org/a.html", tabs[0].url);
+ }));
+ },
+
+ function queryUrlAsArray2() {
+ chrome.tabs.query({url: ["http://*.example.org/*", "*://*.google.com/*"]}, pass(function(tabs) {
+ assertEq(2, tabs.length);
+ assertEq("http://example.org/a.html", tabs[0].url);
+ assertEq("http://www.google.com/favicon.ico", tabs[1].url);
+ }));
+ },
+
function queryStatus() {
chrome.tabs.query({status: "complete"}, pass(function(tabs) {
for (var x = 0; x < tabs.length; x++)
« no previous file with comments | « chrome/common/extensions/api/tabs.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698