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

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

Issue 2264983002: MD History: Lazily load element files which are not needed for first paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor tweaks and rebase 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
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_routing_test', function() { 5 cr.define('md_history.history_routing_test', function() {
6 function registerTests() { 6 function registerTests() {
7 suite('routing-test', function() { 7 suite('routing-test', function() {
8 var app; 8 var app;
9 var list; 9 var list;
10 var toolbar; 10 var toolbar;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 return { 79 return {
80 registerTests: registerTests 80 registerTests: registerTests
81 }; 81 };
82 }); 82 });
83 83
84 cr.define('md_history.history_routing_test_with_query_param', function() { 84 cr.define('md_history.history_routing_test_with_query_param', function() {
85 function registerTests() { 85 function registerTests() {
86 suite('routing-with-query-param', function() { 86 suite('routing-with-query-param', function() {
87 var app; 87 var app;
88 var list;
89 var toolbar; 88 var toolbar;
90 var expectedQuery; 89 var expectedQuery;
91 90
92 suiteSetup(function() { 91 suiteSetup(function() {
93 app = $('history-app'); 92 app = $('history-app');
94 sidebar = app.$['side-bar']
95 toolbar = app.$['toolbar']; 93 toolbar = app.$['toolbar'];
96 expectedQuery = 'query'; 94 expectedQuery = 'query';
97 }); 95 });
98 96
99 test('search initiated on load', function(done) { 97 test('search initiated on load', function(done) {
100 var verifyFunction = function(info) { 98 var verifyFunction = function(info) {
101 assertEquals(expectedQuery, info[0]); 99 assertEquals(expectedQuery, info[0]);
102 flush().then(function() { 100 flush().then(function() {
103 assertEquals( 101 assertEquals(
104 expectedQuery, 102 expectedQuery,
105 toolbar.$['main-toolbar'].getSearchField().getValue()); 103 toolbar.$['main-toolbar'].getSearchField().getValue());
106 done(); 104 done();
107 }); 105 });
108 }; 106 };
109 107
110 if (window.historyQueryInfo) { 108 if (window.historyQueryInfo) {
111 verifyFunction(window.historyQueryInfo); 109 verifyFunction(window.historyQueryInfo);
112 return; 110 return;
113 } 111 }
114 112
115 registerMessageCallback('queryHistory', this, verifyFunction); 113 registerMessageCallback('queryHistory', this, verifyFunction);
116 }); 114 });
117 }); 115 });
118 } 116 }
119 return { 117 return {
120 registerTests: registerTests 118 registerTests: registerTests
121 }; 119 };
122 }); 120 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698