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

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

Issue 2504813002: MD History: Remove unnecessary namespacing from tests (Closed)
Patch Set: Remove newlines 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_overflow_menu_test.js
diff --git a/chrome/test/data/webui/md_history/history_overflow_menu_test.js b/chrome/test/data/webui/md_history/history_overflow_menu_test.js
index 24e88afdce1fd0c5ddf50973ed548d119f493caf..5f407a0778b1329bf65ab7b0e0ff4ab399db77e0 100644
--- a/chrome/test/data/webui/md_history/history_overflow_menu_test.js
+++ b/chrome/test/data/webui/md_history/history_overflow_menu_test.js
@@ -2,82 +2,74 @@
// 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_overflow_menu_test', function() {
- // Menu button event.
- var MENU_EVENT = {
- detail: {
- target: null
- }
- };
+// Menu button event.
+var MENU_EVENT = {
+ detail: {
+ target: null
+ }
+};
- var ADDITIONAL_MENU_EVENT = {
- detail: {
- target: null
- }
- };
+var ADDITIONAL_MENU_EVENT = {
+ detail: {
+ target: null
+ }
+};
- function registerTests() {
- suite('#overflow-menu', function() {
- var app;
- var listContainer;
- var sharedMenu;
+suite('#overflow-menu', function() {
+ var app;
+ var listContainer;
+ var sharedMenu;
- suiteSetup(function() {
- app = $('history-app');
- listContainer = app.$['history'];
- var element1 = document.createElement('div');
- var element2 = document.createElement('div');
- document.body.appendChild(element1);
- document.body.appendChild(element2);
+ suiteSetup(function() {
+ app = $('history-app');
+ listContainer = app.$['history'];
+ var element1 = document.createElement('div');
+ var element2 = document.createElement('div');
+ document.body.appendChild(element1);
+ document.body.appendChild(element2);
- MENU_EVENT.detail.target = element1;
- ADDITIONAL_MENU_EVENT.detail.target = element2;
- sharedMenu = listContainer.$.sharedMenu.get();
- });
+ MENU_EVENT.detail.target = element1;
+ ADDITIONAL_MENU_EVENT.detail.target = element2;
+ sharedMenu = listContainer.$.sharedMenu.get();
+ });
- test('opening and closing menu', function() {
- listContainer.toggleMenu_(MENU_EVENT);
- assertTrue(sharedMenu.menuOpen);
- assertEquals(MENU_EVENT.detail.target, sharedMenu.lastAnchor_);
+ test('opening and closing menu', function() {
+ listContainer.toggleMenu_(MENU_EVENT);
+ assertTrue(sharedMenu.menuOpen);
+ assertEquals(MENU_EVENT.detail.target, sharedMenu.lastAnchor_);
- // Test having the same menu event (pressing the same button) closes
- // the overflow menu.
- listContainer.toggleMenu_(MENU_EVENT);
- assertFalse(sharedMenu.menuOpen);
+ // Test having the same menu event (pressing the same button) closes
+ // the overflow menu.
+ listContainer.toggleMenu_(MENU_EVENT);
+ assertFalse(sharedMenu.menuOpen);
- // Test having consecutive distinct menu events moves the menu to the
- // new button.
- listContainer.toggleMenu_(MENU_EVENT);
- listContainer.toggleMenu_(ADDITIONAL_MENU_EVENT);
- assertEquals(
- ADDITIONAL_MENU_EVENT.detail.target, sharedMenu.lastAnchor_);
- assertTrue(sharedMenu.menuOpen);
+ // Test having consecutive distinct menu events moves the menu to the
+ // new button.
+ listContainer.toggleMenu_(MENU_EVENT);
+ listContainer.toggleMenu_(ADDITIONAL_MENU_EVENT);
+ assertEquals(ADDITIONAL_MENU_EVENT.detail.target, sharedMenu.lastAnchor_);
+ assertTrue(sharedMenu.menuOpen);
- listContainer.toggleMenu_(MENU_EVENT);
- assertTrue(sharedMenu.menuOpen);
- assertEquals(MENU_EVENT.detail.target, sharedMenu.lastAnchor_);
+ listContainer.toggleMenu_(MENU_EVENT);
+ assertTrue(sharedMenu.menuOpen);
+ assertEquals(MENU_EVENT.detail.target, sharedMenu.lastAnchor_);
- sharedMenu.closeMenu();
- assertFalse(sharedMenu.menuOpen);
- });
+ sharedMenu.closeMenu();
+ assertFalse(sharedMenu.menuOpen);
+ });
- test('menu closes when search changes', function() {
- var entry =
- [createHistoryEntry('2016-07-19', 'https://www.nianticlabs.com')];
+ test('menu closes when search changes', function() {
+ var entry =
+ [createHistoryEntry('2016-07-19', 'https://www.nianticlabs.com')];
- app.historyResult(createHistoryInfo(), entry);
- listContainer.toggleMenu_(MENU_EVENT);
- // Menu closes when search changes.
- app.historyResult(createHistoryInfo('niantic'), entry);
- assertFalse(sharedMenu.menuOpen);
- });
+ app.historyResult(createHistoryInfo(), entry);
+ listContainer.toggleMenu_(MENU_EVENT);
+ // Menu closes when search changes.
+ app.historyResult(createHistoryInfo('niantic'), entry);
+ assertFalse(sharedMenu.menuOpen);
+ });
- teardown(function() {
- sharedMenu.lastAnchor_ = null;
- });
- });
- }
- return {
- registerTests: registerTests
- };
+ teardown(function() {
+ sharedMenu.lastAnchor_ = null;
+ });
});

Powered by Google App Engine
This is Rietveld 408576698