| OLD | NEW |
| 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 Loading... |
| 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 }); |
| OLD | NEW |