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

Unified Diff: third_party/WebKit/LayoutTests/inspector/components/widget-events.html

Issue 2466123002: DevTools: reformat front-end code to match chromium style. (Closed)
Patch Set: all done 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: third_party/WebKit/LayoutTests/inspector/components/widget-events.html
diff --git a/third_party/WebKit/LayoutTests/inspector/components/widget-events.html b/third_party/WebKit/LayoutTests/inspector/components/widget-events.html
index 82582f5ca67c1818c5baaed6735dce5969711e1b..874e364341c2366308e068ec06fae032da960bad 100644
--- a/third_party/WebKit/LayoutTests/inspector/components/widget-events.html
+++ b/third_party/WebKit/LayoutTests/inspector/components/widget-events.html
@@ -5,50 +5,49 @@
function test()
{
- function TestWidget(widgetName)
- {
- WebInspector.Widget.call(this);
-
- this._widgetName = widgetName;
- this._processWillShowCount = 0;
- this._processWasHiddenCount = 0;
- InspectorTest.addResult(this._widgetName + "()");
- }
-
- TestWidget.prototype = {
- _processWillShow: function()
+ var TestWidget = class extends WebInspector.Widget {
+ constructor(widgetName)
+ {
+ super();
+ this._widgetName = widgetName;
+ this._processWillShowCount = 0;
+ this._processWasHiddenCount = 0;
+ InspectorTest.addResult(this._widgetName + "()");
+ }
+
+ _processWillShow()
{
InspectorTest.assertEquals(this._processWillShowCount, this._processWasHiddenCount);
- WebInspector.Widget.prototype._processWillShow.call(this);
+ super._processWillShow();
++this._processWillShowCount;
- },
+ }
- _processWasHidden: function()
+ _processWasHidden()
{
- WebInspector.Widget.prototype._processWasHidden.call(this);
+ super._processWasHidden();
++this._processWasHiddenCount;
InspectorTest.assertEquals(this._processWillShowCount, this._processWasHiddenCount);
- },
+ }
- show: function(parentElement)
+ show(parentElement)
{
InspectorTest.addResult(this._widgetName + ".show()");
- WebInspector.Widget.prototype.show.call(this, parentElement);
- },
+ super.show(parentElement);
+ }
- detach: function()
+ detach()
{
InspectorTest.addResult(this._widgetName + ".detach()");
- WebInspector.Widget.prototype.detach.call(this);
- },
+ super.detach();
+ }
- doResize: function()
+ doResize()
{
InspectorTest.addResult(this._widgetName + ".doResize()");
- WebInspector.Widget.prototype.doResize.call(this);
- },
+ super.doResize();
+ }
- wasShown: function()
+ wasShown()
{
InspectorTest.addResult(" " + this._widgetName + ".wasShown()");
if (this.showOnWasShown)
@@ -57,25 +56,23 @@ function test()
this.detachOnWasShown.detach();
if (this.resizeOnWasShown)
this.resizeOnWasShown.doResize();
- },
+ }
- willHide: function()
+ willHide()
{
InspectorTest.addResult(" " + this._widgetName + ".willHide()");
if (this.showOnWillHide)
this.showOnWillHide.show(this.element);
if (this.detachOnWillHide)
this.detachOnWillHide.detach();
- },
+ }
- onResize: function()
+ onResize()
{
InspectorTest.addResult(" " + this._widgetName + ".onResize()");
}
};
- TestWidget.prototype.__proto__ = WebInspector.Widget.prototype;
-
InspectorTest.runTestSuite([
function testShowWidget(next)
{

Powered by Google App Engine
This is Rietveld 408576698