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

Unified Diff: chrome/test/data/extensions/api_test/declarative/api/background.js

Issue 2940133002: [Extensions] Update DeclarativeApiTest.DeclarativeApi (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | 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/declarative/api/background.js
diff --git a/chrome/test/data/extensions/api_test/declarative/api/background.js b/chrome/test/data/extensions/api_test/declarative/api/background.js
index 702b65c883df67e8c8358f07d36e735c73eb7e5e..8715be22bbe115c88d155b1da8ce31dd654d3fbf 100644
--- a/chrome/test/data/extensions/api_test/declarative/api/background.js
+++ b/chrome/test/data/extensions/api_test/declarative/api/background.js
@@ -80,7 +80,7 @@ chrome.test.runTests([
},
function testInvalidGetRules() {
try {
- testEvent.getRules(function() {});
+ testEvent.getRules(1, function() {});
chrome.test.fail();
} catch(e) {
chrome.test.succeed();
@@ -88,7 +88,7 @@ chrome.test.runTests([
},
function testInvalidRemoveRules() {
try {
- testEvent.removeRules(function() {});
+ testEvent.removeRules(1, function() {});
chrome.test.fail();
} catch(e) {
chrome.test.succeed();
@@ -113,8 +113,8 @@ chrome.test.runTests([
chrome.test.assertNoLastError();
// We are not given any gurantee on the order in which rules are returned.
chrome.test.assertTrue(
- chrome.test.checkDeepEq([outputRule0, outputRule1], rules) ||
- chrome.test.checkDeepEq([outputRule1, outputRule0], rules));
+ chrome.test.checkDeepEq([outputRule0, outputRule1], rules) ||
+ chrome.test.checkDeepEq([outputRule1, outputRule0], rules));
chrome.test.succeed();
}
testEvent.getRules(null, callback);
@@ -125,8 +125,8 @@ chrome.test.runTests([
chrome.test.assertNoLastError();
// We are not given any gurantee on the order in which rules are returned.
chrome.test.assertTrue(
- chrome.test.checkDeepEq([outputRule0, outputRule1], rules) ||
- chrome.test.checkDeepEq([outputRule1, outputRule0], rules));
+ chrome.test.checkDeepEq([outputRule0, outputRule1], rules) ||
+ chrome.test.checkDeepEq([outputRule1, outputRule0], rules));
chrome.test.succeed();
}
testEvent.getRules(undefined, callback);
@@ -135,13 +135,28 @@ chrome.test.runTests([
function testGetRules3() {
var callback = function(rules) {
chrome.test.assertNoLastError();
- // We are not given any gurantee on the order in which rules are returned.
chrome.test.assertEq([], rules);
chrome.test.succeed();
}
testEvent.getRules([], callback);
},
- // Check that getRules() returns all rules if rules are filtered by ID.
+ // TODO(devlin): The documentation for event.getRules() states that the
+ // filter parameter is optional. However, with JS bindings, we throw an error
+ // if it's omitted. This is fixed with native bindings.
+ // Check that getRules() returns all rules if the filter is omitted.
+ // function testGetRules4() {
+ // var callback = function(rules) {
+ // chrome.test.assertNoLastError();
+ // // We are not given any gurantee on the order in which rules are
+ // // returned.
+ // chrome.test.assertTrue(
+ // chrome.test.checkDeepEq([outputRule0, outputRule1], rules) ||
+ // chrome.test.checkDeepEq([outputRule1, outputRule0], rules));
+ // chrome.test.succeed();
+ // }
+ // testEvent.getRules(callback);
+ // },
+ // Check that getRules() returns matching rules if rules are filtered by ID.
function testSelectiveGetRules() {
var callback = function(rules) {
chrome.test.assertNoLastError();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698