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

Unified Diff: chrome/test/data/webui/md_history/history_list_test.js

Issue 2404763002: Refactor overall test suite, use replaceApp in HistoryListTest (Closed)
Patch Set: Undo namespacing change Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/md_history/history_list_test.js
diff --git a/chrome/test/data/webui/md_history/history_list_test.js b/chrome/test/data/webui/md_history/history_list_test.js
index 075fdfc851aa4be92fe96822c33210f30793cd1b..65f43442fda3a5ba8e23643a170238ea015dd2e9 100644
--- a/chrome/test/data/webui/md_history/history_list_test.js
+++ b/chrome/test/data/webui/md_history/history_list_test.js
@@ -1,10 +1,9 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
cr.define('md_history.history_list_test', function() {
function registerTests() {
- suite('history-list', function() {
+ suite('<history-list>', function() {
var app;
var element;
var toolbar;
@@ -12,10 +11,6 @@ cr.define('md_history.history_list_test', function() {
var ADDITIONAL_RESULTS;
suiteSetup(function() {
- app = $('history-app');
- element = app.$['history'].$['infinite-list'];
- toolbar = app.$['toolbar'];
-
TEST_HISTORY_RESULTS = [
createHistoryEntry('2016-03-15', 'https://www.google.com'),
createHistoryEntry('2016-03-14 10:00', 'https://www.example.com'),
@@ -33,6 +28,9 @@ cr.define('md_history.history_list_test', function() {
});
setup(function() {
+ app = replaceApp();
+ element = app.$['history'].$['infinite-list'];
Dan Beam 2016/11/03 18:07:51 naughty
tsergeant 2016/11/03 22:34:32 😓
+ toolbar = app.$['toolbar'];
app.queryState_.incremental = true;
});
@@ -264,6 +262,7 @@ cr.define('md_history.history_list_test', function() {
test('more from this site sends and sets correct data', function(done) {
app.queryState_.queryingDisabled = false;
+ app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS);
PolymerTest.flushTasks().then(function () {
registerMessageCallback('queryHistory', this, function (info) {
assertEquals('www.google.com', info[0]);
@@ -560,15 +559,9 @@ cr.define('md_history.history_list_test', function() {
});
teardown(function() {
- element.historyData_ = [];
registerMessageCallback('removeVisits', this, undefined);
registerMessageCallback('queryHistory', this, function() {});
registerMessageCallback('navigateToUrl', this, undefined);
- app.queryState_.queryingDisabled = true;
- app.set('queryState_.searchTerm', '');
- // Unselect all items, clear the list.
- element.addNewResults([], false);
- return PolymerTest.flushTasks();
});
});
}

Powered by Google App Engine
This is Rietveld 408576698