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

Side by Side Diff: chrome/test/data/extensions/api_test/bindings/api_enums/background.js

Issue 969063002: [Extensions] Expose enums on extension APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 chrome.test.runTests([
6 function() {
7 // Test management (backed by a json file) api enums.
8
9 // The enum should be declared on the API object.
10 chrome.test.assertTrue(
11 'LaunchType' in chrome.management,
12 '"LaunchType" is not present on chrome.management.');
13 // The object should have entries for each enum entry. Note that we don't
14 // test all entries here because we don't want to update this test if the
15 // management api changes.
16 chrome.test.assertTrue(
17 'OPEN_AS_REGULAR_TAB' in chrome.management.LaunchType,
18 '"OPEN_AS_REGULAR_TAB" is not present on management.LaunchType');
19 // The value of the enum should be its string value.
20 chrome.test.assertEq(chrome.management.LaunchType.OPEN_AS_REGULAR_TAB,
21 'OPEN_AS_REGULAR_TAB');
22 // There should be more than one value for the enum.
23 chrome.test.assertTrue(
24 Object.keys(chrome.management.LaunchType).length > 1);
25
26 // Perform an analogous test for the notifications api (backed by an idl).
27 chrome.test.assertTrue(
28 'PermissionLevel' in chrome.notifications,
29 '"PermissionLevel" is not present on chrome.notifications.');
30 chrome.test.assertTrue(
31 'granted' in chrome.notifications.PermissionLevel,
32 '"granted" is not present on notifications.PermissionLevel');
33 chrome.test.assertEq(chrome.notifications.PermissionLevel.granted,
34 'granted');
35 chrome.test.assertTrue(
36 Object.keys(chrome.notifications.PermissionLevel).length > 1);
37
38 chrome.test.succeed();
39 }
40 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698