Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/preference/standard/test.js |
| diff --git a/chrome/test/data/extensions/api_test/preference/standard/test.js b/chrome/test/data/extensions/api_test/preference/standard/test.js |
| index 972c2b98af877e0be94b622fb2854af621a5228d..4cd58979945e672f49d6ea2c94e449cce3b581f9 100644 |
| --- a/chrome/test/data/extensions/api_test/preference/standard/test.js |
| +++ b/chrome/test/data/extensions/api_test/preference/standard/test.js |
| @@ -9,7 +9,8 @@ var preferences_to_test = [ |
| { |
| root: chrome.privacy.network, |
| preferences: [ |
| - 'networkPredictionEnabled' |
| + 'networkPredictionEnabled', |
| + 'webRTCMultipleRoutesEnabled' |
| ] |
| }, |
| { |
| @@ -37,6 +38,13 @@ var preferences_to_test = [ |
| }, |
| ]; |
| +// Some preferences are only present on certain platforms or are hidden |
| +// behind flags and might not be present when this test runs. |
| +var possibly_missing_preferences = [ |
|
not at google - send to devlin
2015/02/19 16:10:22
An idle thought, I don't have much of an opinion h
msramek
2015/02/19 16:35:28
Oh. Sure, it's nicer :)
Furthermore, this made me
|
| + 'protectedContentEnabled', // Windows/ChromeOS only |
| + 'webRTCMultipleRoutesEnabled' // requires ENABLE_WEBRTC=1 |
| +] |
| + |
| function expect(expected, message) { |
| return chrome.test.callbackPass(function(value) { |
| chrome.test.assertEq(expected, value, message); |
| @@ -51,18 +59,14 @@ function expectFalse(pref) { |
| } |
| function prefGetter(pref) { |
| - if (pref === 'protectedContentEnabled' && !this[pref]) { |
| - // `protectedContentEnabled` is Windows/ChromeOS only, so it might not exist |
| - // when this test runs, and that's pretty much OK. |
| + if (possibly_missing_preferences.indexOf(pref) != -1 && !this[pref]) { |
| return true; |
| } |
| this[pref].get({}, expectFalse(pref)); |
| } |
| function prefSetter(pref) { |
| - if (pref === 'protectedContentEnabled' && !this[pref]) { |
| - // `protectedContentEnabled` is Windows/ChromeOS only, so it might not exist |
| - // when this test runs, and that's pretty much OK. |
| + if (possibly_missing_preferences.indexOf(pref) != -1 && !this[pref]) { |
| return true; |
| } |
| this[pref].set({value: true}, chrome.test.callbackPass()); |