Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: chrome/browser/ui/webui/options/startup_page_list_browsertest.js

Issue 543863002: Typecheck chrome://bookmarks using Closure Compiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@true_master
Patch Set: debug warns Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 TEST_F('StartupPageListWebUITest', 'testDropFromOutsideSource', function() { 125 TEST_F('StartupPageListWebUITest', 'testDropFromOutsideSource', function() {
126 /** @const */ var NEW_PAGE = 'http://google.com'; 126 /** @const */ var NEW_PAGE = 'http://google.com';
127 127 console.warn('VPDBG: 127');
128 var mockDropEvent = createMouseEvent('drop'); 128 var mockDropEvent = createMouseEvent('drop');
129 console.warn('VPDBG: 129');
129 mockDropEvent.dataTransfer.setData('url', NEW_PAGE); 130 mockDropEvent.dataTransfer.setData('url', NEW_PAGE);
131 console.warn('VPDBG: 131');
130 132
131 this.mockHandler.expects(once()).addStartupPage([NEW_PAGE, 0]); 133 this.mockHandler.expects(once()).addStartupPage([NEW_PAGE, 0]);
134 console.warn('VPDBG: 134');
132 135
133 this.getList().items[0].dispatchEvent(mockDropEvent); 136 this.getList().items[0].dispatchEvent(mockDropEvent);
137 console.warn('VPDBG: 137');
134 138
135 expectTrue(mockDropEvent.defaultPrevented); 139 expectTrue(mockDropEvent.defaultPrevented);
140 console.warn('VPDBG: 140');
136 }); 141 });
137 142
138 TEST_F('StartupPageListWebUITest', 'testDropToReorder', function() { 143 TEST_F('StartupPageListWebUITest', 'testDropToReorder', function() {
139 // TODO(dbeam): mock4js doesn't handle complex arguments well. Fix this. 144 // TODO(dbeam): mock4js doesn't handle complex arguments well. Fix this.
145 console.warn('VPDBG: 145');
140 this.mockHandler.expects(once()).dragDropStartupPage([0, [1].join()]); 146 this.mockHandler.expects(once()).dragDropStartupPage([0, [1].join()]);
147 console.warn('VPDBG: 147');
141 148
142 this.getList().selectionModel.selectedIndex = 1; 149 this.getList().selectionModel.selectedIndex = 1;
150 console.warn('VPDBG: 150');
143 expectEquals(1, this.getList().selectionModel.selectedIndexes.length); 151 expectEquals(1, this.getList().selectionModel.selectedIndexes.length);
152 console.warn('VPDBG: 152');
144 153
145 this.getList().items[0].dispatchEvent(createMouseEvent('drop')); 154 this.getList().items[0].dispatchEvent(createMouseEvent('drop'));
155 console.warn('VPDBG: 155');
146 }); 156 });
147 157
148 }()); 158 }());
OLDNEW
« no previous file with comments | « chrome/browser/resources/bookmark_manager/js/main.js ('k') | third_party/closure_compiler/externs/bookmark_manager_private.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698