| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 /** @fileoverview Suite of tests for Settings.PrefUtil. */ | 5 /** @fileoverview Suite of tests for Settings.PrefUtil. */ |
| 6 cr.define('settings_prefUtil', function() { | 6 cr.define('settings_prefUtil', function() { |
| 7 function registerTests() { | 7 function registerTests() { |
| 8 suite('PrefUtil', function() { | 8 suite('PrefUtil', function() { |
| 9 // Import source before running suite. | |
| 10 suiteSetup(function() { | |
| 11 return PolymerTest.importHtml( | |
| 12 'chrome://md-settings/prefs/pref_util.html'); | |
| 13 }); | |
| 14 | |
| 15 var global = function() { return this; }(); | 9 var global = function() { return this; }(); |
| 16 var origTraceAssertionsForTesting = global.traceAssertionsForTesting; | 10 var origTraceAssertionsForTesting = global.traceAssertionsForTesting; |
| 17 | 11 |
| 18 /** | 12 /** |
| 19 * @param {function()} fn Function that should throw. | 13 * @param {function()} fn Function that should throw. |
| 20 * @param {string} message Message to log if function does not throw. | 14 * @param {string} message Message to log if function does not throw. |
| 21 */ | 15 */ |
| 22 var expectThrows = function(fn, message) { | 16 var expectThrows = function(fn, message) { |
| 23 // Temporarily disable printing of stack traces on assert failures. | 17 // Temporarily disable printing of stack traces on assert failures. |
| 24 global.traceAssertionsForTesting = false; | 18 global.traceAssertionsForTesting = false; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 {foo: 1}, null); | 93 {foo: 1}, null); |
| 100 }, 'Dictionary prefs should not be handled.'); | 94 }, 'Dictionary prefs should not be handled.'); |
| 101 }); | 95 }); |
| 102 }); | 96 }); |
| 103 } | 97 } |
| 104 | 98 |
| 105 return { | 99 return { |
| 106 registerTests: registerTests, | 100 registerTests: registerTests, |
| 107 }; | 101 }; |
| 108 }); | 102 }); |
| OLD | NEW |