| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 * Fixture for startup pages WebUI tests. | 6 * Fixture for startup pages WebUI tests. |
| 7 * @extends {testing.Test} | 7 * @extends {testing.Test} |
| 8 * @constructor | 8 * @constructor |
| 9 */ | 9 */ |
| 10 function StartupPageListWebUITest() {} | 10 function StartupPageListWebUITest() {} |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 * installed. | 115 * installed. |
| 116 * @param {string} type A type of mouse event (e.g. 'drop'). | 116 * @param {string} type A type of mouse event (e.g. 'drop'). |
| 117 * @return {!Event} A fake mouse event. | 117 * @return {!Event} A fake mouse event. |
| 118 */ | 118 */ |
| 119 function createMouseEvent(type) { | 119 function createMouseEvent(type) { |
| 120 var event = new MouseEvent(type, {bubbles: true, cancelable: true}); | 120 var event = new MouseEvent(type, {bubbles: true, cancelable: true}); |
| 121 MockDataTransfer.install(event); | 121 MockDataTransfer.install(event); |
| 122 return event; | 122 return event; |
| 123 } | 123 } |
| 124 | 124 |
| 125 // Disabled due to: crbug.com/419370 | 125 // Disable if flaky again (crbug.com/419370) |
| 126 TEST_F('StartupPageListWebUITest', 'DISABLED_testDropFromOutsideSource', | 126 TEST_F('StartupPageListWebUITest', 'testDropFromOutsideSource', |
| 127 function() { | 127 function() { |
| 128 /** @const */ var NEW_PAGE = 'http://google.com'; | 128 /** @const */ var NEW_PAGE = 'http://google.com'; |
| 129 | 129 |
| 130 var mockDropEvent = createMouseEvent('drop'); | 130 var mockDropEvent = createMouseEvent('drop'); |
| 131 mockDropEvent.dataTransfer.setData('url', NEW_PAGE); | 131 mockDropEvent.dataTransfer.setData('url', NEW_PAGE); |
| 132 | 132 |
| 133 this.mockHandler.expects(once()).addStartupPage([NEW_PAGE, 0]); | 133 this.mockHandler.expects(once()).addStartupPage([NEW_PAGE, 0]); |
| 134 | 134 |
| 135 this.getList().items[0].dispatchEvent(mockDropEvent); | 135 this.getList().items[0].dispatchEvent(mockDropEvent); |
| 136 | 136 |
| 137 expectTrue(mockDropEvent.defaultPrevented); | 137 expectTrue(mockDropEvent.defaultPrevented); |
| 138 }); | 138 }); |
| 139 | 139 |
| 140 // Disabled due to: crbug.com/419370 | 140 // Disable if flaky again (crbug.com/419370) |
| 141 TEST_F('StartupPageListWebUITest', 'DISABLED_testDropToReorder', function() { | 141 TEST_F('StartupPageListWebUITest', 'testDropToReorder', function() { |
| 142 // TODO(dbeam): mock4js doesn't handle complex arguments well. Fix this. | 142 // TODO(dbeam): mock4js doesn't handle complex arguments well. Fix this. |
| 143 this.mockHandler.expects(once()).dragDropStartupPage([0, [1].join()]); | 143 this.mockHandler.expects(once()).dragDropStartupPage([0, [1].join()]); |
| 144 | 144 |
| 145 this.getList().selectionModel.selectedIndex = 1; | 145 this.getList().selectionModel.selectedIndex = 1; |
| 146 expectEquals(1, this.getList().selectionModel.selectedIndexes.length); | 146 expectEquals(1, this.getList().selectionModel.selectedIndexes.length); |
| 147 | 147 |
| 148 this.getList().items[0].dispatchEvent(createMouseEvent('drop')); | 148 this.getList().items[0].dispatchEvent(createMouseEvent('drop')); |
| 149 }); | 149 }); |
| 150 | 150 |
| 151 }()); | 151 }()); |
| OLD | NEW |