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

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: Fixed review comments 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
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9c7b2412a76fe55f668f5b09d9e788452f2cc0d0 100644
--- a/Source/devtools/front_end/main/Tests.js
+++ b/Source/devtools/front_end/main/Tests.js
@@ -489,6 +489,44 @@ TestSuite.prototype.testDeviceMetricsOverrides = function()
this.waitForThrottler(WebInspector.overridesSupport._deviceMetricsThrottler, step1);
};
+TestSuite.prototype.testSettings = function()
+{
+ var test = this;
+
+ createSettings();
+ test.takeControl();
+ setTimeout(reset, 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 reset()
+ {
+ Runtime.experiments.clearForTest();
+ InspectorFrontendHost.getPreferences(gotPreferences);
+ }
+
+ function gotPreferences(prefs)
+ {
+ WebInspector.Main._instanceForTest._createSettings(prefs);
+
+ 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();
« no previous file with comments | « 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