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

Unified Diff: Source/devtools/front_end/main/Tests.js

Issue 1170193002: [DevTools] Add uiTest.testSettings. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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: Source/devtools/front_end/main/Tests.js
diff --git a/Source/devtools/front_end/main/Tests.js b/Source/devtools/front_end/main/Tests.js
index afa448c58e1f54ef67a763a78b89a450005d50db..f482d60aa559f0ded4d5c3e11e6239046a70e5bb 100644
--- a/Source/devtools/front_end/main/Tests.js
+++ b/Source/devtools/front_end/main/Tests.js
@@ -489,6 +489,41 @@ TestSuite.prototype.testDeviceMetricsOverrides = function()
this.waitForThrottler(WebInspector.overridesSupport._deviceMetricsThrottler, step1);
};
+TestSuite.prototype.testSettings = function()
+{
+ var test = this;
+
+ createSettings();
+ test.takeControl();
+ setTimeout(resetAndCheck, 0);
+
+ function createSettings()
+ {
+ var localSetting = WebInspector.settings.createSetting("local", undefined, true);
+ localSetting.set({s: "local", n: 1 });
+ var globalSetting = WebInspector.settings.createSetting("global", undefined, false);
+ globalSetting.set({s: "global", n: 2 });
+ }
+
+ function resetAndCheck()
+ {
+ WebInspector.Main._instance._resetSettingsForTest(checkSettings);
+ }
+
+ function checkSettings()
+ {
+ var localSetting = WebInspector.settings.createSetting("local", undefined, true);
+ test.assertEquals("object", typeof localSetting.get());
+ test.assertEquals("local", localSetting.get().s);
+ test.assertEquals(1, localSetting.get().n);
+ var globalSetting = WebInspector.settings.createSetting("global", undefined, false);
+ test.assertEquals("object", typeof globalSetting.get());
+ test.assertEquals("global", globalSetting.get().s);
+ test.assertEquals(2, globalSetting.get().n);
+ test.releaseControl();
+ }
+}
+
TestSuite.prototype.waitForTestResultsInConsole = function()
{
var messages = WebInspector.multitargetConsoleModel.messages();
« Source/devtools/front_end/main/Main.js ('K') | « Source/devtools/front_end/main/Main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698