OLD | NEW |
---|---|
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=ExtensionPreferenceApiTest.Standard |
7 | 7 |
8 var pn = chrome.privacy.network; | |
8 var preferences_to_test = [ | 9 var preferences_to_test = [ |
9 { | 10 { |
10 root: chrome.privacy.network, | 11 root: chrome.privacy.network, |
11 preferences: [ | 12 preferences: [ |
12 'networkPredictionEnabled', | 13 'networkPredictionEnabled', |
13 'webRTCMultipleRoutesEnabled', | 14 'webRTCMultipleRoutesEnabled', |
14 'webRTCNonProxiedUdpEnabled' | 15 'webRTCNonProxiedUdpEnabled' |
15 ] | 16 ] |
16 }, | 17 }, |
17 { | 18 { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 for (var i = 0; i < preferences_to_test.length; i++) { | 80 for (var i = 0; i < preferences_to_test.length; i++) { |
80 preferences_to_test[i].preferences.forEach( | 81 preferences_to_test[i].preferences.forEach( |
81 prefGetter.bind(preferences_to_test[i].root)); | 82 prefGetter.bind(preferences_to_test[i].root)); |
82 } | 83 } |
83 }, | 84 }, |
84 function setGlobals() { | 85 function setGlobals() { |
85 for (var i = 0; i < preferences_to_test.length; i++) { | 86 for (var i = 0; i < preferences_to_test.length; i++) { |
86 preferences_to_test[i].preferences.forEach( | 87 preferences_to_test[i].preferences.forEach( |
87 prefSetter.bind(preferences_to_test[i].root)); | 88 prefSetter.bind(preferences_to_test[i].root)); |
88 } | 89 } |
90 }, | |
91 function getWebRTCIPHandlingPolicy() { | |
92 if (pn.webRTCIPHandlingPolicy == undefined) { | |
93 chrome.test.callbackPass(); | |
94 return; | |
95 } | |
96 pn.webRTCIPHandlingPolicy.get( | |
97 {}, | |
98 expect({ value: | |
Devlin
2015/10/28 22:39:37
no spaces between brackets and keys/values. Also,
guoweis_webrtc
2015/10/29 21:34:54
Done.
| |
99 chrome.privacy.IPHandlingPolicy.DEFAULT_PUBLIC_INTERFACE_ONLY, | |
100 'levelOfControl': "controllable_by_this_extension" }, | |
Devlin
2015/10/28 22:39:37
no quotes around keys.
Devlin
2015/10/28 22:39:37
prefer single quotes in JS
guoweis_webrtc
2015/10/29 21:34:54
Done.
| |
101 "should receive default_public_interface_only.")); | |
102 }, | |
103 function setWebRTCIPHandlingPolicy() { | |
104 if (pn.webRTCIPHandlingPolicy == undefined) { | |
105 chrome.test.callbackPass(); | |
106 return; | |
107 } | |
108 pn.webRTCIPHandlingPolicy.set( | |
109 { value: | |
110 chrome.privacy.IPHandlingPolicy.DISABLE_NON_PROXIED_UDP}, | |
111 expect({ value: | |
Devlin
2015/10/28 22:39:37
Umm... this shouldn't pass. The callback doesn't
guoweis_webrtc
2015/10/29 21:34:54
My bad. This test doesn't pass. I switched the ord
| |
112 chrome.privacy.IPHandlingPolicy.DISABLE_NON_PROXIED_UDP, | |
113 'levelOfControl': "controllable_by_this_extension" }, | |
114 "should receive disable_non_proxied_udp.")); | |
89 } | 115 } |
90 ]); | 116 ]); |
OLD | NEW |