Index: libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/GlobalJsObjectTest.java |
diff --git a/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/GlobalJsObjectTest.java b/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/GlobalJsObjectTest.java |
index f0eed61ccad69f4146dc776bfd8760d78aacd02f..deae644f71a93a563136ea14ea71d9dac8c0295d 100644 |
--- a/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/GlobalJsObjectTest.java |
+++ b/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/GlobalJsObjectTest.java |
@@ -23,53 +23,53 @@ import org.junit.Test; |
public class GlobalJsObjectTest extends BaseJsTest |
{ |
- @Test |
- public void testSetTimeout() throws InterruptedException |
- { |
- jsEngine.evaluate("setTimeout(function() {foo = 'bar';}, 100)"); |
- assertTrue(jsEngine.evaluate("this.foo").isUndefined()); |
- Thread.sleep(200); |
- assertEquals("bar", jsEngine.evaluate("this.foo").asString()); |
- } |
+ @Test |
+ public void testSetTimeout() throws InterruptedException |
+ { |
+ jsEngine.evaluate("setTimeout(function() {foo = 'bar';}, 100)"); |
+ assertTrue(jsEngine.evaluate("this.foo").isUndefined()); |
+ Thread.sleep(200); |
+ assertEquals("bar", jsEngine.evaluate("this.foo").asString()); |
+ } |
- @Test |
- public void testSetTimeoutWithArgs() throws InterruptedException |
- { |
- jsEngine.evaluate("setTimeout(function(s) {foo = s;}, 100, 'foobar')"); |
- assertTrue(jsEngine.evaluate("this.foo").isUndefined()); |
- Thread.sleep(200); |
- assertEquals("foobar", jsEngine.evaluate("this.foo").asString()); |
- } |
+ @Test |
+ public void testSetTimeoutWithArgs() throws InterruptedException |
+ { |
+ jsEngine.evaluate("setTimeout(function(s) {foo = s;}, 100, 'foobar')"); |
+ assertTrue(jsEngine.evaluate("this.foo").isUndefined()); |
+ Thread.sleep(200); |
+ assertEquals("foobar", jsEngine.evaluate("this.foo").asString()); |
+ } |
- @Test |
- public void testSetTimeoutWithInvalidArgs() |
+ @Test |
+ public void testSetTimeoutWithInvalidArgs() |
+ { |
+ try |
{ |
- try |
- { |
- jsEngine.evaluate("setTimeout()"); |
- fail(); |
- } catch (AdblockPlusException e) |
- { |
- // ignored |
- } |
- |
- try |
- { |
- jsEngine.evaluate("setTimeout('', 1)"); |
- fail(); |
- } catch (AdblockPlusException e) |
- { |
- // ignored |
- } |
+ jsEngine.evaluate("setTimeout()"); |
+ fail(); |
+ } catch (AdblockPlusException e) |
+ { |
+ // ignored |
} |
- @Test |
- public void testSetMultipleTimeouts() throws InterruptedException |
+ try |
{ |
- jsEngine.evaluate("foo = []"); |
- jsEngine.evaluate("setTimeout(function(s) {foo.push('1');}, 100)"); |
- jsEngine.evaluate("setTimeout(function(s) {foo.push('2');}, 150)"); |
- Thread.sleep(200); |
- assertEquals("1,2", jsEngine.evaluate("this.foo").asString()); |
+ jsEngine.evaluate("setTimeout('', 1)"); |
+ fail(); |
+ } catch (AdblockPlusException e) |
+ { |
+ // ignored |
} |
+ } |
+ |
+ @Test |
+ public void testSetMultipleTimeouts() throws InterruptedException |
+ { |
+ jsEngine.evaluate("foo = []"); |
+ jsEngine.evaluate("setTimeout(function(s) {foo.push('1');}, 100)"); |
+ jsEngine.evaluate("setTimeout(function(s) {foo.push('2');}, 150)"); |
+ Thread.sleep(200); |
+ assertEquals("1,2", jsEngine.evaluate("this.foo").asString()); |
+ } |
} |