Title: [176376] trunk/Source/WebInspectorUI
- Revision
- 176376
- Author
- [email protected]
- Date
- 2014-11-19 18:19:12 -0800 (Wed, 19 Nov 2014)
Log Message
Web Inspector: LayoutTests/inspector should not have localStorage side effects
https://bugs.webkit.org/show_bug.cgi?id=138895
Patch by Joseph Pecoraro <[email protected]> on 2014-11-19
Reviewed by Brian Burg.
When running inspector tests, do not restore/save WebInspector.Settings
to localStorage, as that will cause side effects. Instead each Setting
will be initialized with its default value and can be modified during
the run of the test.
* UserInterface/Base/Test.js:
(WebInspector.loaded):
Name the setting to match the normal setting name now that persistence
is not an issue.
* UserInterface/Models/Setting.js:
(WebInspector.Setting.prototype.get value):
(WebInspector.Setting.prototype.set value):
Do not restore/save when in tests.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (176375 => 176376)
--- trunk/Source/WebInspectorUI/ChangeLog 2014-11-20 02:03:47 UTC (rev 176375)
+++ trunk/Source/WebInspectorUI/ChangeLog 2014-11-20 02:19:12 UTC (rev 176376)
@@ -1,5 +1,27 @@
2014-11-19 Joseph Pecoraro <[email protected]>
+ Web Inspector: LayoutTests/inspector should not have localStorage side effects
+ https://bugs.webkit.org/show_bug.cgi?id=138895
+
+ Reviewed by Brian Burg.
+
+ When running inspector tests, do not restore/save WebInspector.Settings
+ to localStorage, as that will cause side effects. Instead each Setting
+ will be initialized with its default value and can be modified during
+ the run of the test.
+
+ * UserInterface/Base/Test.js:
+ (WebInspector.loaded):
+ Name the setting to match the normal setting name now that persistence
+ is not an issue.
+
+ * UserInterface/Models/Setting.js:
+ (WebInspector.Setting.prototype.get value):
+ (WebInspector.Setting.prototype.set value):
+ Do not restore/save when in tests.
+
+2014-11-19 Joseph Pecoraro <[email protected]>
+
Web Inspector: JSContext inspection Resource search does not work
https://bugs.webkit.org/show_bug.cgi?id=131252
Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Test.js (176375 => 176376)
--- trunk/Source/WebInspectorUI/UserInterface/Base/Test.js 2014-11-20 02:03:47 UTC (rev 176375)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Test.js 2014-11-20 02:19:12 UTC (rev 176376)
@@ -67,7 +67,8 @@
// Perform one-time tasks.
WebInspector.CSSCompletions.requestCSSNameCompletions();
- this.showShadowDOMSetting = new WebInspector.Setting("test-show-shadow-dom", true);
+ // Global settings.
+ this.showShadowDOMSetting = new WebInspector.Setting("show-shadow-dom", true);
}
WebInspector.contentLoaded = function()
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/Setting.js (176375 => 176376)
--- trunk/Source/WebInspectorUI/UserInterface/Models/Setting.js 2014-11-20 02:03:47 UTC (rev 176375)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Setting.js 2014-11-20 02:19:12 UTC (rev 176376)
@@ -62,7 +62,7 @@
// Make a copy of the default value so changes to object values don't modify the default value.
this._value = JSON.parse(JSON.stringify(this._defaultValue));
- if (window.localStorage && this._localStorageKey in window.localStorage) {
+ if (!window.InspectorTest && window.localStorage && this._localStorageKey in window.localStorage) {
try {
this._value = JSON.parse(window.localStorage[this._localStorageKey]);
} catch(e) {
@@ -77,7 +77,7 @@
{
this._value = value;
- if (window.localStorage) {
+ if (!window.InspectorTest && window.localStorage) {
try {
// Use Object.shallowEqual to properly compare objects.
if (Object.shallowEqual(this._value, this._defaultValue))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes