| 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 /** | 5 /** |
| 6 * TestFixture for browser options WebUI testing. | 6 * TestFixture for browser options WebUI testing. |
| 7 * @extends {testing.Test} | 7 * @extends {testing.Test} |
| 8 * @constructor | 8 * @constructor |
| 9 */ | 9 */ |
| 10 function BrowserOptionsWebUITest() {} | 10 function BrowserOptionsWebUITest() {} |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 * @extends {testing.Test} | 34 * @extends {testing.Test} |
| 35 * @constructor | 35 * @constructor |
| 36 */ | 36 */ |
| 37 function BrowserOptionsOverlayWebUITest() {} | 37 function BrowserOptionsOverlayWebUITest() {} |
| 38 | 38 |
| 39 BrowserOptionsOverlayWebUITest.prototype = { | 39 BrowserOptionsOverlayWebUITest.prototype = { |
| 40 __proto__: testing.Test.prototype, | 40 __proto__: testing.Test.prototype, |
| 41 | 41 |
| 42 /** @override */ | 42 /** @override */ |
| 43 browsePreload: 'chrome://chrome/settings/autofill', | 43 browsePreload: 'chrome://chrome/settings/autofill', |
| 44 |
| 45 /** @override */ |
| 46 isAsync: true, |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 TEST_F('BrowserOptionsOverlayWebUITest', 'testNavigationInBackground', | 49 TEST_F('BrowserOptionsOverlayWebUITest', 'testNavigationInBackground', |
| 47 function() { | 50 function() { |
| 48 assertEquals(this.browsePreload, document.location.href); | 51 assertEquals(this.browsePreload, document.location.href); |
| 49 expectTrue($('navigation').classList.contains('background')); | 52 |
| 53 if ($('navigation').classList.contains('background')) { |
| 54 testDone(); |
| 55 return; |
| 56 } |
| 57 |
| 58 // Wait for the message to be posted to the Uber page. |
| 59 window.addEventListener('message', function(e) { |
| 60 if (e.data.method == 'beginInterceptingEvents') { |
| 61 window.setTimeout(function() { |
| 62 assertTrue($('navigation').classList.contains('background')); |
| 63 testDone(); |
| 64 }); |
| 65 } |
| 66 }); |
| 50 }); | 67 }); |
| 51 | 68 |
| 52 /** | 69 /** |
| 53 * @extends {testing.Test} | 70 * @extends {testing.Test} |
| 54 * @constructor | 71 * @constructor |
| 55 */ | 72 */ |
| 56 function BrowserOptionsFrameWebUITest() {} | 73 function BrowserOptionsFrameWebUITest() {} |
| 57 | 74 |
| 58 BrowserOptionsFrameWebUITest.prototype = { | 75 BrowserOptionsFrameWebUITest.prototype = { |
| 59 __proto__: testing.Test.prototype, | 76 __proto__: testing.Test.prototype, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 78 __proto__: testing.Test.prototype, | 95 __proto__: testing.Test.prototype, |
| 79 | 96 |
| 80 /** @override */ | 97 /** @override */ |
| 81 browsePreload: 'chrome://settings-frame/autofill', | 98 browsePreload: 'chrome://settings-frame/autofill', |
| 82 }; | 99 }; |
| 83 | 100 |
| 84 TEST_F('AdvancedSettingsWebUITest', 'testAdvancedSettingsShown', function() { | 101 TEST_F('AdvancedSettingsWebUITest', 'testAdvancedSettingsShown', function() { |
| 85 assertEquals(this.browsePreload, document.location.href); | 102 assertEquals(this.browsePreload, document.location.href); |
| 86 expectFalse($('advanced-settings').hidden); | 103 expectFalse($('advanced-settings').hidden); |
| 87 }); | 104 }); |
| OLD | NEW |