瀏覽代碼

Revert "Replaced css inject hack in TestUtils with Page.Styles.add() #11798"

Removing this change to make the tests behave more nicely until #11848 has been fixed.

This reverts commit f2c2236cf8

Change-Id: I776699f5082273e9c4d11248cc35e7ed6b665873
tags/7.1.0
Leif Åstrand 11 年之前
父節點
當前提交
0a437a54af
共有 1 個檔案被更改,包括 12 行新增3 行删除
  1. 12
    3
      uitest/src/com/vaadin/tests/util/TestUtils.java

+ 12
- 3
uitest/src/com/vaadin/tests/util/TestUtils.java 查看文件

@@ -99,13 +99,22 @@ public class TestUtils {
"YE", "ZAMBIA", "ZM", "ZIMBABWE", "ZW" };

/**
* Injects css into the current window. Can be used to keep tests css in
* source files.
* Crossbrowser hack to dynamically add css current window. Can be used to
* keep tests css in source files.
*
* @param cssString
*/
public static void injectCSS(UI w, String cssString) {
w.getPage().getStyles().add(cssString);
String script = "if ('\\v'=='v') /* ie only */ {\n"
+ " document.createStyleSheet().cssText = '"
+ cssString
+ "';\n"
+ " } else {var tag = document.createElement('style'); tag.type = 'text/css';"
+ " document.getElementsByTagName('head')[0].appendChild(tag);tag[ (typeof "
+ "document.body.style.WebkitAppearance=='string') /* webkit only */ ? 'innerText' "
+ ": 'innerHTML'] = '" + cssString + "';}";

w.getPage().getJavaScript().execute(script);
}

public static void installPerformanceReporting(TextArea targetTextArea) {

Loading…
取消
儲存