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

Unified Diff: android_webview/tools/system_webview_shell/layout_tests/src/org/chromium/webview_shell/test/WebViewLayoutTest.java

Issue 2694283007: Revert of [WebViewLayoutTest] Implement a fallback mechanism and re-enable testWebViewIncludedStableInterface… (Closed)
Patch Set: Created 3 years, 10 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 | « android_webview/tools/system_webview_shell/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/tools/system_webview_shell/layout_tests/src/org/chromium/webview_shell/test/WebViewLayoutTest.java
diff --git a/android_webview/tools/system_webview_shell/layout_tests/src/org/chromium/webview_shell/test/WebViewLayoutTest.java b/android_webview/tools/system_webview_shell/layout_tests/src/org/chromium/webview_shell/test/WebViewLayoutTest.java
index 8bd9124e0f48faca8040d5e36dc62b0277e69ea2..a7218502d06b5b5d427402276ae5a731eff3a559 100644
--- a/android_webview/tools/system_webview_shell/layout_tests/src/org/chromium/webview_shell/test/WebViewLayoutTest.java
+++ b/android_webview/tools/system_webview_shell/layout_tests/src/org/chromium/webview_shell/test/WebViewLayoutTest.java
@@ -22,10 +22,8 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
@@ -41,24 +39,12 @@
private static final String BASE_WEBVIEW_TEST_PATH =
"android_webview/tools/system_webview_shell/test/data/";
private static final String BASE_BLINK_TEST_PATH = "third_party/WebKit/LayoutTests/";
+ private static final String BASE_BLINK_STABLE_TEST_PATH =
+ BASE_BLINK_TEST_PATH + "virtual/stable/";
private static final String PATH_WEBVIEW_PREFIX = EXTERNAL_PREFIX + BASE_WEBVIEW_TEST_PATH;
private static final String PATH_BLINK_PREFIX = EXTERNAL_PREFIX + BASE_BLINK_TEST_PATH;
- private static final String GLOBAL_LISTING_FILE =
- "webexposed/global-interface-listing-expected.txt";
-
- // Due to the specifics of the rebaselining algorithm in blink the files containing
- // stable interfaces can dissapear and reappear later. To select the file to compare
- // against a fallback approach is used. The order in the List below is important due
- // to how blink performs baseline optimizations. For more details see
- // third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/baseline_optimizer.py.
- private static final List<String> BLINK_STABLE_FALLBACKS = Arrays.asList(
- EXTERNAL_PREFIX + BASE_BLINK_TEST_PATH + "virtual/stable/" + GLOBAL_LISTING_FILE,
- EXTERNAL_PREFIX + BASE_BLINK_TEST_PATH + "platform/linux/virtual/stable/"
- + GLOBAL_LISTING_FILE,
- EXTERNAL_PREFIX + BASE_BLINK_TEST_PATH + "platform/win/virtual/stable/"
- + GLOBAL_LISTING_FILE,
- EXTERNAL_PREFIX + BASE_BLINK_TEST_PATH + "platform/mac/virtual/stable/"
- + GLOBAL_LISTING_FILE);
+ private static final String PATH_BLINK_STABLE_PREFIX =
+ EXTERNAL_PREFIX + BASE_BLINK_STABLE_TEST_PATH;
private static final long TIMEOUT_SECONDS = 20;
@@ -171,12 +157,14 @@
assertEquals("Unexpected webview interfaces found", "", unexpected.toString());
}
+ @DisabledTest(message = "crbug.com/683153")
@MediumTest
public void testWebViewIncludedStableInterfaces() throws Exception {
ensureJsTestCopied();
loadUrlWebViewAsync("file://" + PATH_BLINK_PREFIX
+ "webexposed/global-interface-listing.html", mTestActivity);
- String blinkStableExpected = readFileWithFallbacks(BLINK_STABLE_FALLBACKS);
+ String blinkStableExpected = readFile(PATH_BLINK_STABLE_PREFIX
+ + "webexposed/global-interface-listing-expected.txt");
String webviewExcluded = readFile(PATH_WEBVIEW_PREFIX
+ "webexposed/not-webview-exposed.txt");
mTestActivity.waitForFinish(TIMEOUT_SECONDS, TimeUnit.SECONDS);
@@ -355,21 +343,6 @@
}
/**
- * Reads the first available file in the 'fallback' list and returns the result.
- * Throws FileNotFoundException if non of the files exist.
- */
- private static String readFileWithFallbacks(List<String> fallbackFileNames) throws IOException {
- for (String fileName : fallbackFileNames) {
- File file = new File(fileName);
- if (file.exists()) {
- return readFile(fileName);
- }
- }
-
- throw new FileNotFoundException("None of the fallback files could be read");
- }
-
- /**
* Writes a file with the given fileName and contents. If overwrite is true overwrites any
* exisiting file with the same file name. If the file does not exist any intermediate
* required directories are created.
« no previous file with comments | « android_webview/tools/system_webview_shell/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698