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

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

Issue 2615773002: [Extensions Bindings] Add enum support (Closed)
Patch Set: nits Created 3 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 | « no previous file | extensions/renderer/api_binding.h » ('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/background.js
diff --git a/chrome/test/data/extensions/api_test/native_bindings/background.js b/chrome/test/data/extensions/api_test/native_bindings/background.js
index 9ec8032cbf407b34a45ca9928cf52f12d8999597..0f3482003462b6dbdaec6ceda4b08e541b528bea 100644
--- a/chrome/test/data/extensions/api_test/native_bindings/background.js
+++ b/chrome/test/data/extensions/api_test/native_bindings/background.js
@@ -17,15 +17,17 @@ if (!chrome || !chrome.test)
chrome.test.runTests([
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.
- // TODO(devlin): Update this to use chrome.idle.IdleState.[ACTIVE|IDLE]
- // when we have enums in native bindings.
- chrome.test.assertTrue(state == 'idle' || state == 'active', state);
+ chrome.test.assertTrue(state == chrome.idle.IdleState.IDLE ||
+ state == chrome.idle.IdleState.ACTIVE);
chrome.test.succeed();
});
},
« no previous file with comments | « no previous file | extensions/renderer/api_binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698