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

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

Issue 2060023002: WebUI: cr-search-field: Remove delegation pattern, use simple event instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@search_box0
Patch Set: Address comments, fix compilation. Created 4 years, 6 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 }); 42 });
43 }); 43 });
44 44
45 test('search term gathered correctly from toolbar', function(done) { 45 test('search term gathered correctly from toolbar', function(done) {
46 app.queryingDisabled_ = false; 46 app.queryingDisabled_ = false;
47 registerMessageCallback('queryHistory', this, function (info) { 47 registerMessageCallback('queryHistory', this, function (info) {
48 assertEquals(info[0], 'Test'); 48 assertEquals(info[0], 'Test');
49 done(); 49 done();
50 }); 50 });
51 51
52 toolbar.onSearch('Test'); 52 toolbar.$$('cr-toolbar').fire('search-changed', 'Test');
53 }); 53 });
54 54
55 teardown(function() { 55 teardown(function() {
56 element.historyData_ = []; 56 element.historyData_ = [];
57 element.searchedTerm = ''; 57 element.searchedTerm = '';
58 registerMessageCallback('queryHistory', this, undefined); 58 registerMessageCallback('queryHistory', this, undefined);
59 toolbar.count = 0; 59 toolbar.count = 0;
60 }); 60 });
61 }); 61 });
62 } 62 }
63 return { 63 return {
64 registerTests: registerTests 64 registerTests: registerTests
65 }; 65 };
66 }); 66 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698