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

Unified Diff: chrome/test/data/webui/settings/settings_menu_test.js

Issue 1952863002: [MD settings] unit test for settings-menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 7 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
« no previous file with comments | « chrome/test/data/webui/settings/cr_settings_browsertest.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/settings_menu_test.js
diff --git a/chrome/test/data/webui/settings/settings_menu_test.js b/chrome/test/data/webui/settings/settings_menu_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..492d7677ad356d64c88f88f0ea619678a86ba63c
--- /dev/null
+++ b/chrome/test/data/webui/settings/settings_menu_test.js
@@ -0,0 +1,41 @@
+// 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.
+
+/** @fileoverview Runs tests for the settings menu. */
+
+cr.define('settings_menu', function() {
+ function registerSettingsMenuTest() {
+ var settingsMenu = null;
+
+ suite('SettingsMenu', function() {
+ setup(function() {
+ PolymerTest.clearBody();
+ settingsMenu = document.createElement('settings-menu');
+ document.body.appendChild(settingsMenu);
+ });
+
+ teardown(function() { settingsMenu.remove(); });
+
+ test('defaultToBasic', function() {
+ settingsMenu.currentRoute = {page: 'basic', section: '', subpage: []};
+ assertFalse(!!settingsMenu.$.advancedPage.opened);
dpapad 2016/05/05 00:11:29 paper-submenu#opened property is a boolean already
dschuyler 2016/05/05 00:23:49 Done.
+ assertTrue(!!settingsMenu.$.basicPage.opened);
+ });
+
+ test('openAdvanced', function() {
+ settingsMenu.currentRoute = {
+ page: 'advanced', section: '', subpage: []
+ };
+ assertTrue(!!settingsMenu.$.advancedPage.opened);
+ assertFalse(!!settingsMenu.$.basicPage.opened);
+ });
+ });
dpapad 2016/05/05 00:11:29 Optional: Can we add a test for the case where cur
dschuyler 2016/05/05 00:23:49 Done.
+ }
+
+ return {
+ registerTests: function() {
+ registerSettingsMenuTest();
+ },
+ };
+});
« no previous file with comments | « chrome/test/data/webui/settings/cr_settings_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698