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

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

Issue 2613503004: MD History: Move flaky focus tests into interactive UI tests (Closed)
Patch Set: Remove unnecessary (?) dep Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/md_history/history_toolbar_test.js
diff --git a/chrome/test/data/webui/md_history/history_toolbar_test.js b/chrome/test/data/webui/md_history/history_toolbar_test.js
index e7d7d16a0ae136f490f9633c77f382ac325f3510..ecd9a77230a395c3a4bea54ea22301c096efae0f 100644
--- a/chrome/test/data/webui/md_history/history_toolbar_test.js
+++ b/chrome/test/data/webui/md_history/history_toolbar_test.js
@@ -50,44 +50,22 @@ cr.define('md_history.history_toolbar_test', function() {
app.queryState_.queryingDisabled = false;
registerMessageCallback('queryHistory', this, function (info) {
assertEquals('Test', info[0]);
+ app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS);
done();
});
toolbar.$$('cr-toolbar').fire('search-changed', 'Test');
});
- test('shortcuts to open search field', function() {
- var field = toolbar.$['main-toolbar'].getSearchField();
- field.blur();
- assertFalse(field.showingSearch);
-
- MockInteractions.pressAndReleaseKeyOn(
- document.body, 191, '', '/');
- assertTrue(field.showingSearch);
- assertEquals(field.$.searchInput, field.root.activeElement);
-
- MockInteractions.pressAndReleaseKeyOn(
- field.$.searchInput, 27, '', 'Escape');
- assertFalse(field.showingSearch, 'Pressing escape closes field.');
- assertNotEquals(field.$.searchInput, field.root.activeElement);
-
- var modifier = 'ctrl';
- if (cr.isMac)
- modifier = 'meta';
-
- MockInteractions.pressAndReleaseKeyOn(
- document.body, 70, modifier, 'f');
- assertTrue(field.showingSearch);
- assertEquals(field.$.searchInput, field.root.activeElement);
- });
-
test('spinner is active on search' , function(done) {
app.queryState_.queryingDisabled = false;
registerMessageCallback('queryHistory', this, function (info) {
- assertTrue(toolbar.spinnerActive);
- app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS);
- assertFalse(toolbar.spinnerActive);
- done();
+ PolymerTest.flushTasks().then(function() {
+ assertTrue(toolbar.spinnerActive);
+ app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS);
+ assertFalse(toolbar.spinnerActive);
+ done();
+ });
});
toolbar.$$('cr-toolbar').fire('search-changed', 'Test2');
@@ -133,56 +111,3 @@ cr.define('md_history.history_toolbar_test', function() {
registerTests: registerTests
};
});
-
-
-cr.define('md_history.history_toolbar_focus_test', function() {
- function registerTests() {
- suite('history-toolbar', function() {
- var app;
- var element;
- var toolbar;
- var TEST_HISTORY_RESULTS =
- [createHistoryEntry('2016-03-15', 'https://google.com')];
- ;
-
- setup(function() {
- window.resultsRendered = false;
- app = replaceApp();
-
- element = app.$['history'].$['infinite-list'];
- toolbar = app.$['toolbar'];
- });
-
- test('search bar is focused on load in wide mode', function() {
- toolbar.$['main-toolbar'].narrow_ = false;
-
- historyResult(createHistoryInfo(), []);
- return PolymerTest.flushTasks().then(() => {
- // Ensure the search bar is focused on load.
- assertTrue(
- app.$.toolbar.$['main-toolbar']
- .getSearchField()
- .isSearchFocused());
- });
- });
-
- test('search bar is not focused on load in narrow mode', function() {
- toolbar.$['main-toolbar'].narrow_ = true;
-
- historyResult(createHistoryInfo(), []);
- return PolymerTest.flushTasks().then(() => {
- // Ensure the search bar is focused on load.
- assertFalse(
- $('history-app')
- .$.toolbar.$['main-toolbar']
- .getSearchField()
- .isSearchFocused());
- });
- });
- });
- };
-
- return {
- registerTests: registerTests
- };
-});

Powered by Google App Engine
This is Rietveld 408576698