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

Side by Side Diff: chrome/test/data/extensions/api_test/preference/standard/test.js

Issue 14569010: Enable the settings UI to toggle the device ID on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/api/privacy.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Preferences API test 5 // Preferences API test
6 // Run with browser_tests --gtest_filter=ExtensionApiTest.PreferenceApi 6 // Run with browser_tests --gtest_filter=ExtensionApiTest.PreferenceApi
7 7
8 var preferences_to_test = [ 8 var preferences_to_test = [
9 { 9 {
10 root: chrome.privacy.network, 10 root: chrome.privacy.network,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 function expectFalse(pref) { 44 function expectFalse(pref) {
45 return expect({ 45 return expect({
46 value: false, 46 value: false,
47 levelOfControl: 'controllable_by_this_extension' 47 levelOfControl: 'controllable_by_this_extension'
48 }, '`' + pref + '` is expected to be false.'); 48 }, '`' + pref + '` is expected to be false.');
49 } 49 }
50 50
51 function prefGetter(pref) { 51 function prefGetter(pref) {
52 if (pref === 'protectedContentEnabled' && !this[pref]) { 52 if (pref === 'protectedContentEnabled' && !this[pref]) {
53 // `protectedContentEnabled` is ChromeOS only, so it might not exist when 53 // `protectedContentEnabled` is Windows/ChromeOS only, so it might not exist
54 // this test runs, and that's pretty much OK. 54 // when this test runs, and that's pretty much OK.
55 return true; 55 return true;
56 } 56 }
57 this[pref].get({}, expectFalse(pref)); 57 this[pref].get({}, expectFalse(pref));
58 } 58 }
59 59
60 function prefSetter(pref) { 60 function prefSetter(pref) {
61 if (pref === 'protectedContentEnabled' && !this[pref]) { 61 if (pref === 'protectedContentEnabled' && !this[pref]) {
62 // `protectedContentEnabled` is ChromeOS only, so it might not exist when 62 // `protectedContentEnabled` is Windows/ChromeOS only, so it might not exist
63 // this test runs, and that's pretty much OK. 63 // when this test runs, and that's pretty much OK.
64 return true; 64 return true;
65 } 65 }
66 this[pref].set({value: true}, chrome.test.callbackPass()); 66 this[pref].set({value: true}, chrome.test.callbackPass());
67 } 67 }
68 68
69 chrome.test.runTests([ 69 chrome.test.runTests([
70 function getPreferences() { 70 function getPreferences() {
71 for (var i = 0; i < preferences_to_test.length; i++) { 71 for (var i = 0; i < preferences_to_test.length; i++) {
72 preferences_to_test[i].preferences.forEach( 72 preferences_to_test[i].preferences.forEach(
73 prefGetter.bind(preferences_to_test[i].root)); 73 prefGetter.bind(preferences_to_test[i].root));
74 } 74 }
75 }, 75 },
76 function setGlobals() { 76 function setGlobals() {
77 for (var i = 0; i < preferences_to_test.length; i++) { 77 for (var i = 0; i < preferences_to_test.length; i++) {
78 preferences_to_test[i].preferences.forEach( 78 preferences_to_test[i].preferences.forEach(
79 prefSetter.bind(preferences_to_test[i].root)); 79 prefSetter.bind(preferences_to_test[i].root));
80 } 80 }
81 } 81 }
82 ]); 82 ]);
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/privacy.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698