calabash-android 0.4.8 → 0.4.9.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/calabash-android/lib/TestServer.apk +0 -0
- data/lib/calabash-android/version.rb +1 -1
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/CalabashChromeClient.java +13 -5
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/UnableToFindChromeClientException.java +26 -0
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryASTWith.java +10 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b64a4d3ad951ea41eb7aaa04b1048277c0d5870b
|
4
|
+
data.tar.gz: 6a499be88df0feb60f24634fd54751561fd4e03b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 470cbd5b68524a526cc62667f941da3fb56ef2416f9cd62262dad59e7c10593d2ed561ea8abf1b95099d402c870b186149ad4189d74cd409418bbc47657014fb
|
7
|
+
data.tar.gz: 0e0010e67bc27f489026f727c5d356b884e75a1616cf4377339f52267c758e8bac112dbd0250871dbcfae5e4d9741f97c2eb7ab339e9973a4a1a6276dff3503b
|
Binary file
|
@@ -38,7 +38,6 @@ public class CalabashChromeClient extends WebChromeClient {
|
|
38
38
|
throw new RuntimeException(e);
|
39
39
|
}
|
40
40
|
} else {
|
41
|
-
try {
|
42
41
|
|
43
42
|
/*
|
44
43
|
* pick up the chromeClient from the webView
|
@@ -48,11 +47,20 @@ public class CalabashChromeClient extends WebChromeClient {
|
|
48
47
|
* which lead to the Cordova.exec messages not forward to the Cordova ChromeClient.
|
49
48
|
*/
|
50
49
|
Field field = getChromeClientField(webView.getClass());
|
50
|
+
if (field == null) {
|
51
|
+
throw new UnableToFindChromeClientException(webView);
|
52
|
+
}
|
51
53
|
field.setAccessible(true);
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
54
|
+
try {
|
55
|
+
mWebChromeClient = (WebChromeClient) field.get(webView);
|
56
|
+
} catch (IllegalArgumentException e) {
|
57
|
+
e.printStackTrace();
|
58
|
+
throw new UnableToFindChromeClientException(e, webView);
|
59
|
+
} catch (IllegalAccessException e) {
|
60
|
+
|
61
|
+
e.printStackTrace();
|
62
|
+
throw new UnableToFindChromeClientException(e, webView);
|
63
|
+
}
|
56
64
|
}
|
57
65
|
|
58
66
|
if ( Looper.getMainLooper().getThread() == Thread.currentThread()) {
|
@@ -0,0 +1,26 @@
|
|
1
|
+
package sh.calaba.instrumentationbackend.actions.webview;
|
2
|
+
|
3
|
+
import android.webkit.WebView;
|
4
|
+
|
5
|
+
@SuppressWarnings("serial")
|
6
|
+
public class UnableToFindChromeClientException extends RuntimeException {
|
7
|
+
|
8
|
+
private final WebView webView;
|
9
|
+
|
10
|
+
public UnableToFindChromeClientException(WebView webView) {
|
11
|
+
this.webView = webView;
|
12
|
+
}
|
13
|
+
|
14
|
+
public UnableToFindChromeClientException(Exception e, WebView webView) {
|
15
|
+
super(e);
|
16
|
+
this.webView = webView;
|
17
|
+
}
|
18
|
+
|
19
|
+
public WebView getWebView() {
|
20
|
+
return webView;
|
21
|
+
}
|
22
|
+
|
23
|
+
public String toString() {
|
24
|
+
return super.toString() + "- WebView: " + webView;
|
25
|
+
}
|
26
|
+
}
|
@@ -10,6 +10,8 @@ import java.util.concurrent.Future;
|
|
10
10
|
import org.antlr.runtime.tree.CommonTree;
|
11
11
|
|
12
12
|
import sh.calaba.instrumentationbackend.actions.webview.QueryHelper;
|
13
|
+
import sh.calaba.instrumentationbackend.actions.webview.UnableToFindChromeClientException;
|
14
|
+
import android.util.Log;
|
13
15
|
import android.view.View;
|
14
16
|
import android.webkit.WebView;
|
15
17
|
|
@@ -134,8 +136,14 @@ public class UIQueryASTWith implements UIQueryAST {
|
|
134
136
|
if (!(this.value instanceof String)) {
|
135
137
|
return null;
|
136
138
|
}
|
137
|
-
|
138
|
-
|
139
|
+
try {
|
140
|
+
return QueryHelper.executeAsyncJavascriptInWebviews(o,
|
141
|
+
"calabash.js", (String) this.value,this.propertyName);
|
142
|
+
|
143
|
+
} catch (UnableToFindChromeClientException e) {
|
144
|
+
Log.w("Calabash","Unable to find UnableToFindChromeClientException");
|
145
|
+
return null;
|
146
|
+
}
|
139
147
|
|
140
148
|
}
|
141
149
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calabash-android
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.9.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Maturana Larsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -406,6 +406,7 @@ files:
|
|
406
406
|
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/ScrollTo.java
|
407
407
|
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/SetPropertyByCssSelector.java
|
408
408
|
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/SetText.java
|
409
|
+
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/UnableToFindChromeClientException.java
|
409
410
|
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/json/JSONUtils.java
|
410
411
|
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/CompletedFuture.java
|
411
412
|
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/InvocationOperation.java
|
@@ -858,9 +859,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
858
859
|
version: '0'
|
859
860
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
860
861
|
requirements:
|
861
|
-
- - '
|
862
|
+
- - '>'
|
862
863
|
- !ruby/object:Gem::Version
|
863
|
-
version:
|
864
|
+
version: 1.3.1
|
864
865
|
requirements: []
|
865
866
|
rubyforge_project:
|
866
867
|
rubygems_version: 2.0.2
|