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

Unified Diff: chrome/test/data/extensions/api_test/native_bindings/extension/background.js

Issue 2934573002: [Extensions Bindings] Update test to not use idle (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 | chrome/test/data/extensions/api_test/native_bindings/extension/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/native_bindings/extension/background.js
diff --git a/chrome/test/data/extensions/api_test/native_bindings/extension/background.js b/chrome/test/data/extensions/api_test/native_bindings/extension/background.js
index d4935ebff54f6ea77ce56c97f02e507323548d81..d153c43019bb189b941967846c5c8db27c728f2c 100644
--- a/chrome/test/data/extensions/api_test/native_bindings/extension/background.js
+++ b/chrome/test/data/extensions/api_test/native_bindings/extension/background.js
@@ -17,19 +17,16 @@ var portNumber;
// methods, etc). If any of these stages failed, the test itself would also
// fail.
var tests = [
- function idleApi() {
- chrome.test.assertTrue(!!chrome.idle);
- chrome.test.assertTrue(!!chrome.idle.IdleState);
- chrome.test.assertTrue(!!chrome.idle.IdleState.IDLE);
- chrome.test.assertTrue(!!chrome.idle.IdleState.ACTIVE);
- chrome.test.assertTrue(!!chrome.idle.queryState);
- chrome.idle.queryState(1000, function(state) {
- // Depending on the machine, this could come back as either idle or
- // active. However, all we're curious about is the bindings themselves
- // (not the API implementation), so as long as it's a possible response,
- // it's a success for our purposes.
- chrome.test.assertTrue(state == chrome.idle.IdleState.IDLE ||
- state == chrome.idle.IdleState.ACTIVE);
+ function historyApi() {
+ chrome.test.assertTrue(!!chrome.history);
+ chrome.test.assertTrue(!!chrome.history.TransitionType);
+ chrome.test.assertTrue(!!chrome.history.TransitionType.LINK);
+ chrome.test.assertTrue(!!chrome.history.TransitionType.TYPED);
+ chrome.test.assertTrue(!!chrome.history.getVisits);
+ chrome.history.getVisits({url: 'http://example.com'}, function(visits) {
+ // We're just testing the bindings, not the history API, so we don't
+ // care about the response.
+ chrome.test.assertTrue(!!visits);
chrome.test.succeed();
});
},
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/native_bindings/extension/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698