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

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

Issue 2369823002: MD History: Focus the search field on load without 'showing' it (Closed)
Patch Set: Closure Created 4 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
« no previous file with comments | « chrome/browser/resources/md_history/app.crisper.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 function registerTests() { 109 function registerTests() {
110 suite('history-toolbar', function() { 110 suite('history-toolbar', function() {
111 var app; 111 var app;
112 var element; 112 var element;
113 var toolbar; 113 var toolbar;
114 var TEST_HISTORY_RESULTS = 114 var TEST_HISTORY_RESULTS =
115 [createHistoryEntry('2016-03-15', 'https://google.com')]; 115 [createHistoryEntry('2016-03-15', 'https://google.com')];
116 ; 116 ;
117 117
118 setup(function() { 118 setup(function() {
119 window.resultsRendered = false;
119 app = replaceApp(); 120 app = replaceApp();
120 121
121 element = app.$['history'].$['infinite-list']; 122 element = app.$['history'].$['infinite-list'];
122 toolbar = app.$['toolbar']; 123 toolbar = app.$['toolbar'];
123 }); 124 });
124 125
125 test('search bar is focused on load in wide mode', function() { 126 test('search bar is focused on load in wide mode', function() {
126 window.resultsRendered = false; 127 toolbar.$['main-toolbar'].narrow_ = false;
127 app.hasDrawer_ = false;
128 128
129 historyResult(createHistoryInfo(), []); 129 historyResult(createHistoryInfo(), []);
130 return flush().then(() => { 130 return flush().then(() => {
131 // Ensure the search bar is focused on load. 131 // Ensure the search bar is focused on load.
132 assertTrue( 132 assertTrue(
133 app.$.toolbar.$['main-toolbar'] 133 app.$.toolbar.$['main-toolbar']
134 .getSearchField() 134 .getSearchField()
135 .isSearchFocused()); 135 .isSearchFocused());
136 }); 136 });
137 }); 137 });
138 138
139 test('search bar is not focused on load in narrow mode', function() { 139 test('search bar is not focused on load in narrow mode', function() {
140 app.hasDrawer_ = true; 140 toolbar.$['main-toolbar'].narrow_ = true;
141 141
142 historyResult(createHistoryInfo(), []); 142 historyResult(createHistoryInfo(), []);
143 // Ensure the search bar is focused on load. 143 return flush().then(() => {
144 assertFalse( 144 // Ensure the search bar is focused on load.
145 $('history-app') 145 assertFalse(
146 .$.toolbar.$['main-toolbar'] 146 $('history-app')
147 .getSearchField() 147 .$.toolbar.$['main-toolbar']
148 .isSearchFocused()); 148 .getSearchField()
149 .isSearchFocused());
150 });
149 }); 151 });
150 }); 152 });
151 }; 153 };
152 154
153 return { 155 return {
154 registerTests: registerTests 156 registerTests: registerTests
155 }; 157 };
156 }); 158 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/app.crisper.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698