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

Side by Side Diff: chrome/test/data/webui/md_history/history_toolbar_test.js

Issue 2237703004: [MD History] Focus the search bar on load. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 cr.define('md_history.history_toolbar_test', function() { 5 cr.define('md_history.history_toolbar_test', function() {
6 function registerTests() { 6 function registerTests() {
7 suite('history-toolbar', function() { 7 suite('history-toolbar', function() {
8 var app; 8 var app;
9 var element; 9 var element;
10 var toolbar; 10 var toolbar;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 registerMessageCallback('queryHistory', this, function (info) { 47 registerMessageCallback('queryHistory', this, function (info) {
48 assertEquals('Test', info[0]); 48 assertEquals('Test', info[0]);
49 done(); 49 done();
50 }); 50 });
51 51
52 toolbar.$$('cr-toolbar').fire('search-changed', 'Test'); 52 toolbar.$$('cr-toolbar').fire('search-changed', 'Test');
53 }); 53 });
54 54
55 test('shortcuts to open search field', function() { 55 test('shortcuts to open search field', function() {
56 var field = toolbar.$['main-toolbar'].getSearchField(); 56 var field = toolbar.$['main-toolbar'].getSearchField();
57 assertFalse(field.showingSearch);
tsergeant 2016/08/15 03:28:33 We probably shouldn't blindly delete this -- now w
calamity 2016/08/15 07:40:28 Good point. Done.
58 57
59 MockInteractions.pressAndReleaseKeyOn( 58 MockInteractions.pressAndReleaseKeyOn(
60 document.body, 191, '', '/'); 59 document.body, 191, '', '/');
61 assertTrue(field.showingSearch); 60 assertTrue(field.showingSearch);
62 assertEquals(field.$.searchInput, field.root.activeElement); 61 assertEquals(field.$.searchInput, field.root.activeElement);
63 62
64 MockInteractions.pressAndReleaseKeyOn( 63 MockInteractions.pressAndReleaseKeyOn(
65 field.$.searchInput, 27, '', 'Escape'); 64 field.$.searchInput, 27, '', 'Escape');
66 assertFalse(field.showingSearch, 'Pressing escape closes field.'); 65 assertFalse(field.showingSearch, 'Pressing escape closes field.');
67 assertNotEquals(field.$.searchInput, field.root.activeElement); 66 assertNotEquals(field.$.searchInput, field.root.activeElement);
(...skipping 21 matching lines...) Expand all
89 element.searchedTerm = ''; 88 element.searchedTerm = '';
90 registerMessageCallback('queryHistory', this, undefined); 89 registerMessageCallback('queryHistory', this, undefined);
91 toolbar.count = 0; 90 toolbar.count = 0;
92 }); 91 });
93 }); 92 });
94 } 93 }
95 return { 94 return {
96 registerTests: registerTests 95 registerTests: registerTests
97 }; 96 };
98 }); 97 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698