diff options
author | Maksymilian Osowski <maxosowski@google.com> | 2010-07-12 15:59:26 +0100 |
---|---|---|
committer | Maksymilian Osowski <maxosowski@google.com> | 2010-07-16 14:32:12 +0100 |
commit | 3c8ccb384513dd9bae0f98ac516ea36fbaa3173b (patch) | |
tree | 73fdfa1ea6fd63b205eeb1ad682748d6594cbb37 /tests/DumpRenderTree2/src/com/android/dumprendertree2/AbstractResult.java | |
parent | cc483d25b96dc2e394473e63cac29d06f1e96261 (diff) | |
download | frameworks_base-3c8ccb384513dd9bae0f98ac516ea36fbaa3173b.zip frameworks_base-3c8ccb384513dd9bae0f98ac516ea36fbaa3173b.tar.gz frameworks_base-3c8ccb384513dd9bae0f98ac516ea36fbaa3173b.tar.bz2 |
Added the LayoutTestsRunner class that is responsible for running the tests. Also, added some methods to FileFilter.
It preloads the tests from the given path, runs them and asks for dumps and diffs. It will also prepare summaries in the future. It delegates
most of the work of actually running the individual tests to LayoutTest class and AbstractResult (and its subclasses in the future).
Change-Id: I483bf26a380b539e4769e61b4a09fa270ab0e8e9
Diffstat (limited to 'tests/DumpRenderTree2/src/com/android/dumprendertree2/AbstractResult.java')
-rw-r--r-- | tests/DumpRenderTree2/src/com/android/dumprendertree2/AbstractResult.java | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/AbstractResult.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/AbstractResult.java new file mode 100644 index 0000000..f545840 --- /dev/null +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/AbstractResult.java @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2010 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.dumprendertree2; + +/** + * A class that represent a result of the test. It is responsible for returning the result's + * raw data and generating its own diff in HTML format. + */ +public abstract class AbstractResult { + + public enum TestType { + TEXT, + PIXEL + } + + public enum ResultCode { + PASS("Passed"), + FAIL_RESULT_DIFFERS("Failed: different results"), + FAIL_NO_EXPECTED_RESULT("Failed: no expected result"), + FAIL_TIMED_OUT("Failed: timed out"), + FAIL_CRASHED("Failed: crashed"); + + private String mTitle; + + private ResultCode(String title) { + mTitle = title; + } + + @Override + public String toString() { + return mTitle; + } + } + + /** + * Returns result's raw data that can be written to the disk. + * + * @return + * results raw data + */ + public abstract byte[] getData(); + + /** + * Returns the code of this result. + * + * @return + * the code of this result + */ + public abstract ResultCode getCode(); + + /** + * Return the type of the result data. + * + * @return + * the type of the result data. + */ + public abstract TestType getType(); + + /** + * Returns a piece of HTML code that presents a visual diff between a result and + * the expected result. + * + * @return + * a piece of HTML code with a visual diff between the result and the expected result + */ + public abstract String getDiffAsHtml(); +}
\ No newline at end of file |