The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.android.dumprendertree; |
| 18 | |
Steve Block | 164bd79 | 2010-02-05 10:53:04 +0000 | [diff] [blame] | 19 | import java.util.Vector; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 20 | import android.util.*; |
| 21 | |
| 22 | public class FileFilter { |
| 23 | |
Steve Block | 164bd79 | 2010-02-05 10:53:04 +0000 | [diff] [blame] | 24 | private static final String LOGTAG = "FileFilter"; |
| 25 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | public static boolean ignoreTest(String file) { |
Steve Block | 164bd79 | 2010-02-05 10:53:04 +0000 | [diff] [blame] | 27 | // treat files like directories for the time being. |
| 28 | for (int i = 0; i < ignoreTestList.length; i ++) { |
| 29 | if (file.endsWith(ignoreTestList[i])) { |
| 30 | Log.v(LOGTAG, "File path in list of ignored tests: " + file); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | return true; |
Steve Block | 164bd79 | 2010-02-05 10:53:04 +0000 | [diff] [blame] | 32 | } |
| 33 | } |
| 34 | for (int i = 0; i < ignoreTestDirs.length; i++) { |
| 35 | if (file.endsWith(ignoreTestDirs[i])) { |
| 36 | Log.v(LOGTAG, "File path in list of ignored directories: " + file); |
| 37 | return true; |
| 38 | } |
| 39 | } |
| 40 | // We should run tests for which the expected result is wrong, as there is |
| 41 | // value in checking that they don't cause crashes. |
| 42 | // TODO: Run these tests but ignore the result. |
| 43 | return ignoreResults(file); |
| 44 | } |
| 45 | |
| 46 | public static boolean ignoreResults(String file) { |
| 47 | for (int i = 0; i < ignoreResultList.size(); i++) { |
| 48 | if (file.endsWith(ignoreResultList.get(i))) { |
| 49 | Log.v(LOGTAG, "File path in list of ignored results: " + file); |
| 50 | return true; |
| 51 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | } |
| 53 | return false; |
Steve Block | 164bd79 | 2010-02-05 10:53:04 +0000 | [diff] [blame] | 54 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 55 | |
Steve Block | 164bd79 | 2010-02-05 10:53:04 +0000 | [diff] [blame] | 56 | final static Vector<String> ignoreResultList = new Vector<String>(); |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 57 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | static { |
Steve Block | 164bd79 | 2010-02-05 10:53:04 +0000 | [diff] [blame] | 59 | fillIgnoreResultList(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | static final String[] ignoreTestDirs = { |
| 63 | ".", // ignore hidden directories and files |
| 64 | "resources", // ignore resource directories |
| 65 | "AppleScript", // AppleScript not supported |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 66 | ".svn", // don't run anything under .svn folder |
The Android Open Source Project | ba87e3e | 2009-03-13 13:04:22 -0700 | [diff] [blame] | 67 | "profiler", // profiler is not supported |
| 68 | "svg", // svg is not supported |
| 69 | "platform", // platform specific |
Guang Zhu | 9e58e64 | 2009-10-15 10:45:49 -0700 | [diff] [blame] | 70 | "http/wml", |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 71 | }; |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 72 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 73 | static final String [] ignoreTestList = { |
Guang Zhu | 01033ab | 2009-09-16 15:04:38 -0700 | [diff] [blame] | 74 | "editing/selection/move-left-right.html", |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 75 | "fast/js/regexp-charclass-crash.html", // RegExp is too large, causing OOM |
| 76 | "fast/regex/test1.html", // RegExp is exponential |
| 77 | "fast/regex/slow.html", // RegExp is exponential |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 78 | "storage/domstorage/localstorage/private-browsing-affects-storage.html", // No notion of private browsing. |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 79 | "storage/domstorage/sessionstorage/private-browsing-affects-storage.html", // No notion of private browsing. |
| 80 | "storage/private-browsing-readonly.html", // No notion of private browsing. |
Feng Qian | 89ac33b | 2009-05-05 22:53:42 -0700 | [diff] [blame] | 81 | }; |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 82 | |
Steve Block | 164bd79 | 2010-02-05 10:53:04 +0000 | [diff] [blame] | 83 | static void fillIgnoreResultList() { |
Steve Block | f7483b1 | 2010-02-05 15:56:36 +0000 | [diff] [blame] | 84 | // This first block of tests are for HTML5 features, for which Android |
| 85 | // should pass all tests. They are skipped only temporarily. |
| 86 | // TODO: Fix these failing tests and remove them from this list. |
Steve Block | f7483b1 | 2010-02-05 15:56:36 +0000 | [diff] [blame] | 87 | ignoreResultList.add("http/tests/appcache/auth.html"); // file not found |
| 88 | ignoreResultList.add("http/tests/appcache/deferred-events.html"); // file not found |
| 89 | ignoreResultList.add("http/tests/appcache/deferred-events-delete-while-raising.html"); // file not found |
| 90 | ignoreResultList.add("http/tests/appcache/destroyed-frame.html"); // file not found |
| 91 | ignoreResultList.add("http/tests/appcache/detached-iframe.html"); // file not found |
| 92 | ignoreResultList.add("http/tests/appcache/different-scheme.html"); // file not found |
| 93 | ignoreResultList.add("http/tests/appcache/disabled.html"); // not found |
| 94 | ignoreResultList.add("http/tests/appcache/empty-manifest.html"); // flaky |
| 95 | ignoreResultList.add("http/tests/appcache/foreign-iframe-main.html"); // flaky - skips states |
| 96 | ignoreResultList.add("http/tests/appcache/local-content.html"); // text diff |
| 97 | ignoreResultList.add("http/tests/appcache/max-size.html"); // no layoutTestController.setAppCacheMaximumSize |
| 98 | ignoreResultList.add("http/tests/appcache/manifest-with-empty-file.html"); // flaky |
| 99 | ignoreResultList.add("http/tests/appcache/whitelist-wildcard.html"); // file not found |
| 100 | ignoreResultList.add("storage/database-lock-after-reload.html"); // failure |
Steve Block | f7483b1 | 2010-02-05 15:56:36 +0000 | [diff] [blame] | 101 | |
Steve Block | 432e0ea | 2010-03-05 18:54:55 +0000 | [diff] [blame^] | 102 | // Will always fail |
| 103 | ignoreResultList.add("fast/workers/shared-worker-constructor.html"); // shared workers not supported |
| 104 | ignoreResultList.add("fast/workers/shared-worker-context-gc.html"); // shared workers not supported |
| 105 | ignoreResultList.add("fast/workers/shared-worker-event-listener.html"); // shared workers not supported |
| 106 | ignoreResultList.add("fast/workers/shared-worker-exception.html"); // shared workers not supported |
| 107 | ignoreResultList.add("fast/workers/shared-worker-frame-lifecycle.html"); // shared workers not supported |
| 108 | ignoreResultList.add("fast/workers/shared-worker-gc.html"); // shared workers not supported |
| 109 | ignoreResultList.add("fast/workers/shared-worker-lifecycle.html"); // shared workers not supported |
| 110 | ignoreResultList.add("fast/workers/shared-worker-load-error.html"); // shared workers not supported |
| 111 | ignoreResultList.add("fast/workers/shared-worker-location.html"); // shared workers not supported |
| 112 | ignoreResultList.add("fast/workers/shared-worker-name.html"); // shared workers not supported |
| 113 | ignoreResultList.add("fast/workers/shared-worker-navigator.html"); // shared workers not supported |
| 114 | ignoreResultList.add("fast/workers/shared-worker-replace-global-constructor.html"); // shared workers not supported |
| 115 | ignoreResultList.add("fast/workers/shared-worker-replace-self.html"); // shared workers not supported |
| 116 | ignoreResultList.add("fast/workers/shared-worker-script-error.html"); // shared workers not supported |
| 117 | ignoreResultList.add("fast/workers/shared-worker-shared.html"); // shared workers not supported |
| 118 | ignoreResultList.add("fast/workers/shared-worker-simple.html"); // shared workers not supported |
| 119 | |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 120 | ignoreResultList.add("fast/css/case-transform.html"); // will not fix #619707 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 121 | ignoreResultList.add("fast/dom/Element/offsetLeft-offsetTop-body-quirk.html"); // different screen size result in extra spaces in Apple compared to us |
| 122 | ignoreResultList.add("fast/dom/Window/Plug-ins.html"); // need test plugin |
| 123 | ignoreResultList.add("fast/dom/Window/window-properties.html"); // xslt and xpath elements missing from property list |
| 124 | ignoreResultList.add("fast/dom/Window/window-screen-properties.html"); // pixel depth |
| 125 | ignoreResultList.add("fast/dom/Window/window-xy-properties.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 126 | ignoreResultList.add("fast/dom/attribute-namespaces-get-set.html"); // http://b/733229 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 127 | ignoreResultList.add("fast/dom/gc-9.html"); // requires xpath support |
| 128 | ignoreResultList.add("fast/dom/global-constructors.html"); // requires xslt and xpath support |
| 129 | ignoreResultList.add("fast/dom/object-embed-plugin-scripting.html"); // dynamic plugins not supported |
| 130 | ignoreResultList.add("fast/dom/tabindex-clamp.html"); // there is extra spacing in the file due to multiple input boxes fitting on one line on Apple, ours are wrapped. Space at line ends are stripped. |
| 131 | ignoreResultList.add("fast/events/anchor-image-scrolled-x-y.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 132 | ignoreResultList.add("fast/events/arrow-navigation.html"); // http://b/735233 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 133 | ignoreResultList.add("fast/events/capture-on-target.html"); // requires eventSender.mouseDown(),mouseUp() |
| 134 | ignoreResultList.add("fast/events/dblclick-addEventListener.html"); // requires eventSender.mouseDown(),mouseUp() |
| 135 | ignoreResultList.add("fast/events/drag-in-frames.html"); // requires eventSender.mouseDown(),mouseUp() |
| 136 | ignoreResultList.add("fast/events/drag-outside-window.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 137 | ignoreResultList.add("fast/events/event-view-toString.html"); // requires eventSender.mouseDown(),mouseUp() |
| 138 | ignoreResultList.add("fast/events/frame-click-focus.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 139 | ignoreResultList.add("fast/events/frame-tab-focus.html"); // http://b/734308 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 140 | ignoreResultList.add("fast/events/iframe-object-onload.html"); // there is extra spacing in the file due to multiple frame boxes fitting on one line on Apple, ours are wrapped. Space at line ends are stripped. |
| 141 | ignoreResultList.add("fast/events/input-image-scrolled-x-y.html"); // requires eventSender.mouseDown(),mouseUp() |
| 142 | ignoreResultList.add("fast/events/mouseclick-target-and-positioning.html"); // requires eventSender.mouseDown(),mouseUp() |
| 143 | ignoreResultList.add("fast/events/mouseover-mouseout.html"); // requires eventSender.mouseDown(),mouseUp() |
| 144 | ignoreResultList.add("fast/events/mouseover-mouseout2.html"); // requires eventSender.mouseDown(),mouseUp() |
| 145 | ignoreResultList.add("fast/events/mouseup-outside-button.html"); // requires eventSender.mouseDown(),mouseUp() |
| 146 | ignoreResultList.add("fast/events/mouseup-outside-document.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 147 | ignoreResultList.add("fast/events/onclick-list-marker.html"); // requires eventSender.mouseDown(),mouseUp() |
| 148 | ignoreResultList.add("fast/events/ondragenter.html"); // requires eventSender.mouseDown(),mouseUp() |
| 149 | ignoreResultList.add("fast/events/onload-webkit-before-webcore.html"); // missing space in textrun, ok as text is wrapped. ignore. #714933 |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 150 | ignoreResultList.add("fast/events/option-tab.html"); // http://b/734308 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 151 | ignoreResultList.add("fast/events/window-events-bubble.html"); // requires eventSender.mouseDown(),mouseUp() |
| 152 | ignoreResultList.add("fast/events/window-events-bubble2.html"); // requires eventSender.mouseDown(),mouseUp() |
| 153 | ignoreResultList.add("fast/events/window-events-capture.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 154 | ignoreResultList.add("fast/forms/drag-into-textarea.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 155 | ignoreResultList.add("fast/forms/focus-control-to-page.html"); // http://b/716638 |
| 156 | ignoreResultList.add("fast/forms/focus2.html"); // http://b/735111 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 157 | ignoreResultList.add("fast/forms/form-data-encoding-2.html"); // charset convert. #516936 ignore, won't fix |
| 158 | ignoreResultList.add("fast/forms/form-data-encoding.html"); // charset convert. #516936 ignore, won't fix |
| 159 | ignoreResultList.add("fast/forms/input-appearance-maxlength.html"); // execCommand "insertText" not supported |
| 160 | ignoreResultList.add("fast/forms/input-select-on-click.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 161 | ignoreResultList.add("fast/forms/listbox-onchange.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 162 | ignoreResultList.add("fast/forms/listbox-selection.html"); // http://b/735116 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 163 | ignoreResultList.add("fast/forms/onselect-textarea.html"); // requires eventSender.mouseMoveTo, mouseDown & mouseUp and abs. position of mouse to select a word. ignore, won't fix #716583 |
| 164 | ignoreResultList.add("fast/forms/onselect-textfield.html"); // requires eventSender.mouseMoveTo, mouseDown & mouseUp and abs. position of mouse to select a word. ignore, won't fix #716583 |
| 165 | ignoreResultList.add("fast/forms/plaintext-mode-1.html"); // not implemented queryCommandEnabled:BackColor, Undo & Redo |
| 166 | ignoreResultList.add("fast/forms/search-cancel-button-mouseup.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 167 | ignoreResultList.add("fast/forms/search-event-delay.html"); // http://b/735120 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 168 | ignoreResultList.add("fast/forms/select-empty-list.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 169 | ignoreResultList.add("fast/forms/select-type-ahead-non-latin.html"); // http://b/735244 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 170 | ignoreResultList.add("fast/forms/selected-index-assert.html"); // not capturing the console messages |
| 171 | ignoreResultList.add("fast/forms/selection-functions.html"); // there is extra spacing as the text areas and input boxes fit next to each other on Apple, but are wrapped on our screen. |
| 172 | ignoreResultList.add("fast/forms/textarea-appearance-wrap.html"); // Our text areas are a little thinner than Apples. Also RTL test failes |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 173 | ignoreResultList.add("fast/forms/textarea-initial-caret-position.html"); // Text selection done differently on our platform. When a inputbox gets focus, the entire block is selected. |
| 174 | ignoreResultList.add("fast/forms/textarea-no-scroll-on-blur.html"); // Text selection done differently on our platform. When a inputbox gets focus, the entire block is selected. |
| 175 | ignoreResultList.add("fast/forms/textarea-paste-newline.html"); // Copy&Paste commands not supported |
| 176 | ignoreResultList.add("fast/forms/textarea-scrolled-endline-caret.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 177 | ignoreResultList.add("fast/frames/iframe-window-focus.html"); // http://b/735140 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 178 | ignoreResultList.add("fast/frames/frameElement-widthheight.html"); // screen width&height are different |
| 179 | ignoreResultList.add("fast/frames/frame-js-url-clientWidth.html"); // screen width&height are different |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 180 | ignoreResultList.add("fast/html/tab-order.html"); // http://b/719289 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 181 | ignoreResultList.add("fast/js/navigator-mimeTypes-length.html"); // dynamic plugins not supported |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 182 | ignoreResultList.add("fast/js/string-capitalization.html"); // http://b/516936 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 183 | ignoreResultList.add("fast/loader/local-JavaScript-from-local.html"); // Requires LayoutTests to exist at /tmp/LayoutTests |
| 184 | ignoreResultList.add("fast/loader/local-iFrame-source-from-local.html"); // Requires LayoutTests to exist at /tmp/LayoutTests |
| 185 | ignoreResultList.add("fast/loader/opaque-base-url.html"); // extra spacing because iFrames rendered next to each other on Apple |
Steve Block | 52f4362 | 2010-02-05 10:49:20 +0000 | [diff] [blame] | 186 | ignoreResultList.add("fast/overflow/scroll-vertical-not-horizontal.html"); // http://b/735196 |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 187 | ignoreResultList.add("fast/parser/script-tag-with-trailing-slash.html"); // not capturing the console messages |
| 188 | ignoreResultList.add("fast/replaced/image-map.html"); // requires eventSender.mouseDown(),mouseUp() |
Steve Block | cdb4ef4 | 2010-02-05 10:31:15 +0000 | [diff] [blame] | 189 | ignoreResultList.add("fast/text/plain-text-line-breaks.html"); // extra spacing because iFrames rendered next to each other on Apple |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 190 | } |
Steve Block | 07a76ca | 2010-02-05 00:23:32 +0000 | [diff] [blame] | 191 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 192 | } |