summaryrefslogtreecommitdiffstats
path: root/tests/DumpRenderTree/src/com/android/dumprendertree/FileFilter.java
blob: 6ceb0f927070e833c6e5aa8571af6617138fc60e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.dumprendertree;

import java.util.Vector;
import android.util.*;

public class FileFilter {

    private static final String LOGTAG = "FileFilter";

    public static boolean ignoreTest(String file) {
        // treat files like directories for the time being.
        for (int i = 0; i < ignoreTestList.length; i ++) {
            if (file.endsWith(ignoreTestList[i])) {
                Log.v(LOGTAG, "File path in list of ignored tests: " + file);
                return true;
            }
        }
        for (int i = 0; i < ignoreTestDirs.length; i++) {
            if (file.endsWith(ignoreTestDirs[i])) {
                Log.v(LOGTAG, "File path in list of ignored directories: " + file);
                return true;
            }
        }
        // We should run tests for which the expected result is wrong, as there is
        // value in checking that they don't cause crashes.
        // TODO: Run these tests but ignore the result.
        return ignoreResults(file);
    }

    public static boolean ignoreResults(String file) {
        for (int i = 0; i < ignoreResultList.size(); i++) {
            if (file.endsWith(ignoreResultList.get(i))) {
                Log.v(LOGTAG, "File path in list of ignored results: " + file);
                return true;
            }
        }
        return false;
      }

    final static Vector<String> ignoreResultList = new Vector<String>();

    static {
        fillIgnoreResultList();
    }

    static final String[] ignoreTestDirs = {
        ".", // ignore hidden directories and files
        "resources", // ignore resource directories
        "AppleScript", // AppleScript not supported
        ".svn", // don't run anything under .svn folder
        "profiler",  // profiler is not supported
        "svg",  // svg is not supported
        "platform",  // platform specific
        "http/wml",
    };

    static final String [] ignoreTestList = {
        "editing/selection/move-left-right.html",
        "fast/js/regexp-charclass-crash.html", // RegExp is too large, causing OOM
        "fast/regex/test1.html", // RegExp is exponential
        "fast/regex/slow.html", // RegExp is exponential
        "storage/domstorage/localstorage/private-browsing-affects-storage.html", // No notion of private browsing.
        "storage/domstorage/sessionstorage/private-browsing-affects-storage.html", // No notion of private browsing.
        "storage/private-browsing-readonly.html", // No notion of private browsing.
    };

    static void fillIgnoreResultList() {
        // This first block of tests are for HTML5 features, for which Android
        // should pass all tests. They are skipped only temporarily.
        // TODO: Fix these failing tests and remove them from this list.
        ignoreResultList.add("fast/dom/Geolocation/callback-exception.html"); // exception output incorrect with V8
        ignoreResultList.add("http/tests/appcache/auth.html"); // file not found
        ignoreResultList.add("http/tests/appcache/deferred-events.html"); // file not found
        ignoreResultList.add("http/tests/appcache/deferred-events-delete-while-raising.html"); // file not found
        ignoreResultList.add("http/tests/appcache/destroyed-frame.html"); // file not found
        ignoreResultList.add("http/tests/appcache/detached-iframe.html"); // file not found
        ignoreResultList.add("http/tests/appcache/different-scheme.html"); // file not found
        ignoreResultList.add("http/tests/appcache/disabled.html"); // not found
        ignoreResultList.add("http/tests/appcache/empty-manifest.html"); // flaky
        ignoreResultList.add("http/tests/appcache/foreign-iframe-main.html"); // flaky - skips states
        ignoreResultList.add("http/tests/appcache/local-content.html"); // text diff
        ignoreResultList.add("http/tests/appcache/max-size.html"); // no layoutTestController.setAppCacheMaximumSize
        ignoreResultList.add("http/tests/appcache/manifest-with-empty-file.html"); // flaky
        ignoreResultList.add("http/tests/appcache/whitelist-wildcard.html"); // file not found
        ignoreResultList.add("storage/database-lock-after-reload.html"); // failure
        ignoreResultList.add("storage/domstorage/localstorage/string-conversion.html"); // false failure due to whitespace diff in output with V8
        ignoreResultList.add("storage/domstorage/sessionstorage/string-conversion.html"); // false failure due to whitespace diff in output with V8
        ignoreResultList.add("storage/statement-error-callback.html"); // expected line number diff in V8 only
        ignoreResultList.add("storage/transaction-error-callback.html"); // expected line number diff in V8 only
        ignoreResultList.add("storage/transaction-callback-exception-crash.html"); // expected line number diff in V8 only

        ignoreResultList.add("fast/css/case-transform.html"); // will not fix #619707
        ignoreResultList.add("fast/dom/Element/offsetLeft-offsetTop-body-quirk.html"); // different screen size result in extra spaces in Apple compared to us
        ignoreResultList.add("fast/dom/Window/Plug-ins.html"); // need test plugin
        ignoreResultList.add("fast/dom/Window/window-properties.html"); // xslt and xpath elements missing from property list
        ignoreResultList.add("fast/dom/Window/window-screen-properties.html"); // pixel depth
        ignoreResultList.add("fast/dom/Window/window-xy-properties.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/dom/attribute-namespaces-get-set.html"); // http://b/733229
        ignoreResultList.add("fast/dom/gc-9.html"); // requires xpath support
        ignoreResultList.add("fast/dom/global-constructors.html"); // requires xslt and xpath support
        ignoreResultList.add("fast/dom/object-embed-plugin-scripting.html"); // dynamic plugins not supported
        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.
        ignoreResultList.add("fast/events/anchor-image-scrolled-x-y.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/arrow-navigation.html"); // http://b/735233
        ignoreResultList.add("fast/events/capture-on-target.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/dblclick-addEventListener.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/drag-in-frames.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/drag-outside-window.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/event-view-toString.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/frame-click-focus.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/frame-tab-focus.html"); // http://b/734308
        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.
        ignoreResultList.add("fast/events/input-image-scrolled-x-y.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/mouseclick-target-and-positioning.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/mouseover-mouseout.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/mouseover-mouseout2.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/mouseup-outside-button.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/mouseup-outside-document.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/onclick-list-marker.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/ondragenter.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/onload-webkit-before-webcore.html"); // missing space in textrun, ok as text is wrapped. ignore. #714933
        ignoreResultList.add("fast/events/option-tab.html"); // http://b/734308
        ignoreResultList.add("fast/events/window-events-bubble.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/window-events-bubble2.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/events/window-events-capture.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/forms/drag-into-textarea.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/forms/focus-control-to-page.html"); // http://b/716638
        ignoreResultList.add("fast/forms/focus2.html"); // http://b/735111
        ignoreResultList.add("fast/forms/form-data-encoding-2.html"); // charset convert. #516936 ignore, won't fix
        ignoreResultList.add("fast/forms/form-data-encoding.html"); // charset convert. #516936 ignore, won't fix
        ignoreResultList.add("fast/forms/input-appearance-maxlength.html"); // execCommand "insertText" not supported
        ignoreResultList.add("fast/forms/input-select-on-click.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/forms/listbox-onchange.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/forms/listbox-selection.html"); // http://b/735116
        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
        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
        ignoreResultList.add("fast/forms/plaintext-mode-1.html"); // not implemented queryCommandEnabled:BackColor, Undo & Redo
        ignoreResultList.add("fast/forms/search-cancel-button-mouseup.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/forms/search-event-delay.html"); // http://b/735120
        ignoreResultList.add("fast/forms/select-empty-list.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/forms/select-type-ahead-non-latin.html"); // http://b/735244
        ignoreResultList.add("fast/forms/selected-index-assert.html"); // not capturing the console messages
        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.
        ignoreResultList.add("fast/forms/textarea-appearance-wrap.html"); // Our text areas are a little thinner than Apples. Also RTL test failes
        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.
        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.
        ignoreResultList.add("fast/forms/textarea-paste-newline.html"); // Copy&Paste commands not supported
        ignoreResultList.add("fast/forms/textarea-scrolled-endline-caret.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/frames/iframe-window-focus.html"); // http://b/735140
        ignoreResultList.add("fast/frames/frameElement-widthheight.html"); // screen width&height are different
        ignoreResultList.add("fast/frames/frame-js-url-clientWidth.html"); // screen width&height are different
        ignoreResultList.add("fast/html/tab-order.html"); // http://b/719289
        ignoreResultList.add("fast/js/navigator-mimeTypes-length.html"); // dynamic plugins not supported
        ignoreResultList.add("fast/js/string-capitalization.html"); // http://b/516936
        ignoreResultList.add("fast/loader/local-JavaScript-from-local.html"); // Requires LayoutTests to exist at /tmp/LayoutTests
        ignoreResultList.add("fast/loader/local-iFrame-source-from-local.html"); // Requires LayoutTests to exist at /tmp/LayoutTests
        ignoreResultList.add("fast/loader/opaque-base-url.html"); // extra spacing because iFrames rendered next to each other on Apple
        ignoreResultList.add("fast/overflow/scroll-vertical-not-horizontal.html"); // http://b/735196
        ignoreResultList.add("fast/parser/script-tag-with-trailing-slash.html"); // not capturing the console messages
        ignoreResultList.add("fast/replaced/image-map.html"); // requires eventSender.mouseDown(),mouseUp()
        ignoreResultList.add("fast/text/plain-text-line-breaks.html"); // extra spacing because iFrames rendered next to each other on Apple
    }

}