Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 package org.mozilla.gecko;
8 public class FennecTalosAssert implements Assert {
10 public FennecTalosAssert() { }
12 /**
13 * Write information to a logfile and logcat
14 */
15 public void dumpLog(String message) {
16 FennecNativeDriver.log(FennecNativeDriver.LogLevel.INFO, message);
17 }
19 /** Write information to a logfile and logcat */
20 public void dumpLog(String message, Throwable t) {
21 FennecNativeDriver.log(FennecNativeDriver.LogLevel.INFO, message, t);
22 }
24 /**
25 * Set the filename used for dumpLog.
26 */
27 public void setLogFile(String filename) {
28 FennecNativeDriver.setLogFile(filename);
29 }
31 public void setTestName(String testName) { }
33 public void endTest() { }
35 public void ok(boolean condition, String name, String diag) {
36 if (!condition) {
37 dumpLog("__FAIL" + name + ": " + diag + "__FAIL");
38 }
39 }
41 public void is(Object actual, Object expected, String name) {
42 boolean pass = (actual == null ? expected == null : actual.equals(expected));
43 ok(pass, name, "got " + actual + ", expected " + expected);
44 }
46 public void isnot(Object actual, Object notExpected, String name) {
47 boolean fail = (actual == null ? notExpected == null : actual.equals(notExpected));
48 ok(!fail, name, "got " + actual + ", expected not " + notExpected);
49 }
51 public void ispixel(int actual, int r, int g, int b, String name) {
52 throw new UnsupportedOperationException();
53 }
55 public void isnotpixel(int actual, int r, int g, int b, String name) {
56 throw new UnsupportedOperationException();
57 }
59 public void todo(boolean condition, String name, String diag) {
60 throw new UnsupportedOperationException();
61 }
63 public void todo_is(Object actual, Object expected, String name) {
64 throw new UnsupportedOperationException();
65 }
67 public void todo_isnot(Object actual, Object notExpected, String name) {
68 throw new UnsupportedOperationException();
69 }
71 public void info(String name, String message) {
72 dumpLog(name + ": " + message);
73 }
74 }