summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-10-20 09:00:01 +0200
committerPéter Török <31210544+torok-peter@users.noreply.github.com>2017-10-20 10:00:01 +0300
commit0f4702c6d1e03e2522c556487aba74ea01f25837 (patch)
tree55ff916ebd275e3b1711dc2908b6e2e8773fda9d /uitest
parent780e9cee6b7e976285402a00ad5b282a8e79619e (diff)
downloadvaadin-framework-0f4702c6d1e03e2522c556487aba74ea01f25837.tar.gz
vaadin-framework-0f4702c6d1e03e2522c556487aba74ea01f25837.zip
Add spaces after 'if' and 'for' in JavaScript (#10199)
* Add spaces after 'if' and 'for' in JavaScript * Revert to old format * Remove whitespaces
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/menubar/MenuItemStyleRemoved.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/push/TrackMessageSizeUI.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/util/TestUtils.java6
-rw-r--r--uitest/src/test/java/com/vaadin/tests/layouts/CssLayoutRemoveComponentTest.java2
-rw-r--r--uitest/src/test/java/com/vaadin/tests/layouts/VerticalLayoutRemoveComponentTest.java2
5 files changed, 7 insertions, 7 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuItemStyleRemoved.java b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuItemStyleRemoved.java
index 6724b59ca5..ece7994232 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuItemStyleRemoved.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuItemStyleRemoved.java
@@ -36,7 +36,7 @@ public class MenuItemStyleRemoved extends AbstractReindeerTestUI {
}
JavaScript.getCurrent()
.execute("var x=document." + method + ";"
- + " var i; for(i=0; i < x.length; i++)"
+ + " var i; for (i=0; i < x.length; i++)"
+ " {x[i].className += ' custom-menu-item'};");
}
});
diff --git a/uitest/src/main/java/com/vaadin/tests/push/TrackMessageSizeUI.java b/uitest/src/main/java/com/vaadin/tests/push/TrackMessageSizeUI.java
index 692fd39a5f..f0ae132860 100644
--- a/uitest/src/main/java/com/vaadin/tests/push/TrackMessageSizeUI.java
+++ b/uitest/src/main/java/com/vaadin/tests/push/TrackMessageSizeUI.java
@@ -43,7 +43,7 @@ public class TrackMessageSizeUI extends AbstractTestUIWithLog {
+ " _handleProtocol = function(a,message) {return message;};"
+ " var response = {partialMessage: ''};\n"
+ " var messages = [];\n"
- + " for(var i = 0; i < data.length; i++) {\n"
+ + " for (var i = 0; i < data.length; i++) {\n"
+ " if (!_trackMessageSize(data[i], request, response))\n"
+ " messages = messages.concat(response.messages);\n"
+ " }\n"
diff --git a/uitest/src/main/java/com/vaadin/tests/util/TestUtils.java b/uitest/src/main/java/com/vaadin/tests/util/TestUtils.java
index 650e01a168..3717717822 100644
--- a/uitest/src/main/java/com/vaadin/tests/util/TestUtils.java
+++ b/uitest/src/main/java/com/vaadin/tests/util/TestUtils.java
@@ -117,11 +117,11 @@ public class TestUtils {
public static void installPerformanceReporting(TextArea targetTextArea) {
targetTextArea.setId("performanceTestTarget");
- JavaScript
- .eval("window.reportVaadinPerformance = function(topic, serverLimit, clientLimit, bootstrapTime) {"
+ JavaScript.eval(
+ "window.reportVaadinPerformance = function(topic, serverLimit, clientLimit, bootstrapTime) {"
+ "var element = document.getElementById('performanceTestTarget');"
+ "var text = topic + ': \\n';"
- + "for(var k in window.vaadin.clients) {"
+ + "for (var k in window.vaadin.clients) {"
+ "var p = window.vaadin.clients[k].getProfilingData();"
+ "text += ' Server time: ' + (p[3] > serverLimit?'FAIL':'OK') + ' (' + p[3] +')\\n';"
+ "text += ' Client time: ' + (p[0] > clientLimit?'FAIL':'OK') + ' (' + p[0] +')\\n';"
diff --git a/uitest/src/test/java/com/vaadin/tests/layouts/CssLayoutRemoveComponentTest.java b/uitest/src/test/java/com/vaadin/tests/layouts/CssLayoutRemoveComponentTest.java
index bd66164d08..261b490ec8 100644
--- a/uitest/src/test/java/com/vaadin/tests/layouts/CssLayoutRemoveComponentTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/layouts/CssLayoutRemoveComponentTest.java
@@ -29,7 +29,7 @@ public class CssLayoutRemoveComponentTest extends SingleBrowserTestPhantomJS2 {
openTestURL();
String script = "document.mutationEventCount = 0;"
- + "var observer = new MutationObserver(function(mutations){"
+ + "var observer = new MutationObserver(function(mutations) {"
+ "mutations.forEach(function(mutation) { document.mutationEventCount += mutation.removedNodes.length; });"
+ "});"
+ "observer.observe(arguments[0].parentNode, { childList: true });";
diff --git a/uitest/src/test/java/com/vaadin/tests/layouts/VerticalLayoutRemoveComponentTest.java b/uitest/src/test/java/com/vaadin/tests/layouts/VerticalLayoutRemoveComponentTest.java
index 39d9cc673d..f920a3ddb9 100644
--- a/uitest/src/test/java/com/vaadin/tests/layouts/VerticalLayoutRemoveComponentTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/layouts/VerticalLayoutRemoveComponentTest.java
@@ -30,7 +30,7 @@ public class VerticalLayoutRemoveComponentTest
openTestURL();
String script = "document.mutationEventCount = 0;"
- + "var observer = new MutationObserver(function(mutations){"
+ + "var observer = new MutationObserver(function(mutations) {"
+ "mutations.forEach(function(mutation) { document.mutationEventCount += mutation.removedNodes.length; });"
+ "});"
+ "observer.observe(arguments[0], { childList: true });";