Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/GlobalJsObjectTest.java

Issue 29536596: Issue 5556 - Update to use libadblockplus revision hg:566f64c8a2a8 (Closed) Base URL: github.com:abby-sergz/libadblockplus-android.git
Patch Set: Created Sept. 5, 2017, 12:21 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 13b5400a44a870cef0169b9a4050a8f6c8420869..b0509a350455a5f1e3caceb743f4a7ddec15ff6f 100644
--- a/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/GlobalJsObjectTest.java
+++ b/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests/GlobalJsObjectTest.java
@@ -26,19 +26,19 @@ public class GlobalJsObjectTest extends BaseJsTest
@Test
public void testSetTimeout() throws InterruptedException
{
- jsEngine.evaluate("setTimeout(function() {foo = 'bar';}, 100)");
- assertTrue(jsEngine.evaluate("this.foo").isUndefined());
+ jsEngine.evaluate("let foo; setTimeout(function() {foo = 'bar';}, 100)");
+ assertTrue(jsEngine.evaluate("foo").isUndefined());
Thread.sleep(200);
- assertEquals("bar", jsEngine.evaluate("this.foo").asString());
+ assertEquals("bar", jsEngine.evaluate("foo").asString());
}
@Test
public void testSetTimeoutWithArgs() throws InterruptedException
{
- jsEngine.evaluate("setTimeout(function(s) {foo = s;}, 100, 'foobar')");
- assertTrue(jsEngine.evaluate("this.foo").isUndefined());
+ jsEngine.evaluate("let foo; setTimeout(function(s) {foo = s;}, 100, 'foobar')");
+ assertTrue(jsEngine.evaluate("foo").isUndefined());
Thread.sleep(200);
- assertEquals("foobar", jsEngine.evaluate("this.foo").asString());
+ assertEquals("foobar", jsEngine.evaluate("foo").asString());
}
@Test
@@ -68,10 +68,10 @@ public class GlobalJsObjectTest extends BaseJsTest
@Test
public void testSetMultipleTimeouts() throws InterruptedException
{
- jsEngine.evaluate("foo = []");
+ jsEngine.evaluate("let 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());
+ assertEquals("1,2", jsEngine.evaluate("foo").asString());
}
}

Powered by Google App Engine
This is Rietveld