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

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

Issue 2224003003: Vulcanize MD History to improve page-load performance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.cc ('k') | docs/vulcanize.md » ('j') | 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 MockInteractions.pressAndReleaseKeyOn( 59 MockInteractions.pressAndReleaseKeyOn(
60 document.body, 191, '', '/'); 60 document.body, 191, '', '/');
61 assertTrue(field.showingSearch); 61 assertTrue(field.showingSearch);
62 assertEquals(field.$.searchInput, field.root.activeElement); 62 assertEquals(field.$.searchInput, field.root.activeElement);
63 63
64 MockInteractions.pressAndReleaseKeyOn( 64 MockInteractions.pressAndReleaseKeyOn(
65 field.$.searchInput, 27, '', 'Escape'); 65 field.$.searchInput, 27, '', 'Escape');
66 assertFalse(field.showingSearch, 'Pressing escape closes field.'); 66 assertFalse(field.showingSearch, 'Pressing escape closes field.');
67 assertNotEquals(field.$.searchInput, field.root.activeElement); 67 assertNotEquals(field.$.searchInput, field.root.activeElement);
68 68
69 var modifier = 'ctrl';
70 if (cr.isMac)
71 modifier = 'meta';
72
69 MockInteractions.pressAndReleaseKeyOn( 73 MockInteractions.pressAndReleaseKeyOn(
70 document.body, 70, 'ctrl', 'f'); 74 document.body, 70, modifier, 'f');
71 assertTrue(field.showingSearch); 75 assertTrue(field.showingSearch);
72 assertEquals(field.$.searchInput, field.root.activeElement); 76 assertEquals(field.$.searchInput, field.root.activeElement);
73 }); 77 });
74 78
75 test('spinner is active on search' , function(done) { 79 test('spinner is active on search' , function(done) {
76 app.queryState_.queryingDisabled = false; 80 app.queryState_.queryingDisabled = false;
77 registerMessageCallback('queryHistory', this, function (info) { 81 registerMessageCallback('queryHistory', this, function (info) {
78 assertTrue(toolbar.spinnerActive); 82 assertTrue(toolbar.spinnerActive);
79 app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS); 83 app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS);
80 assertFalse(toolbar.spinnerActive); 84 assertFalse(toolbar.spinnerActive);
81 done(); 85 done();
82 }); 86 });
83 87
84 toolbar.$$('cr-toolbar').fire('search-changed', 'Test2'); 88 toolbar.$$('cr-toolbar').fire('search-changed', 'Test2');
85 }); 89 });
86 90
87 teardown(function() { 91 teardown(function() {
88 element.historyData_ = []; 92 element.historyData_ = [];
89 element.searchedTerm = ''; 93 element.searchedTerm = '';
90 registerMessageCallback('queryHistory', this, undefined); 94 registerMessageCallback('queryHistory', this, undefined);
91 toolbar.count = 0; 95 toolbar.count = 0;
92 }); 96 });
93 }); 97 });
94 } 98 }
95 return { 99 return {
96 registerTests: registerTests 100 registerTests: registerTests
97 }; 101 };
98 }); 102 });
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.cc ('k') | docs/vulcanize.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698