calabash-android 0.4.8 → 0.4.9.pre1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c4cf383a1c32c3098f5141338fe5229d1756fd0
4
- data.tar.gz: b2fac39ede49cc01d0e865d06ee7854f4dc5b12b
3
+ metadata.gz: b64a4d3ad951ea41eb7aaa04b1048277c0d5870b
4
+ data.tar.gz: 6a499be88df0feb60f24634fd54751561fd4e03b
5
5
  SHA512:
6
- metadata.gz: 51cf5feab3c3bb82e2484662dcaa4517212d645b09b9f815270908b5bb1f9b2b1ace25b7c2eeb16d8d193f7ef9ae338e3a0784497c6340beb2f4dd00bfd44a7a
7
- data.tar.gz: c54d2f6cdc3c16b19f3d2c74a7fa3eb2954e6fec9fdfd10dbea1a4d7333d25ef6313af54521ff863329c7e9310205f29d67c5b93051e4579b55ab0d4194d1768
6
+ metadata.gz: 470cbd5b68524a526cc62667f941da3fb56ef2416f9cd62262dad59e7c10593d2ed561ea8abf1b95099d402c870b186149ad4189d74cd409418bbc47657014fb
7
+ data.tar.gz: 0e0010e67bc27f489026f727c5d356b884e75a1616cf4377339f52267c758e8bac112dbd0250871dbcfae5e4d9741f97c2eb7ab339e9973a4a1a6276dff3503b
@@ -1,5 +1,5 @@
1
1
  module Calabash
2
2
  module Android
3
- VERSION = "0.4.8"
3
+ VERSION = "0.4.9.pre1"
4
4
  end
5
5
  end
@@ -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
- mWebChromeClient = (WebChromeClient) field.get(webView);
53
- } catch (Exception e) {
54
- throw new RuntimeException(e);
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
- return QueryHelper.executeAsyncJavascriptInWebviews(o,
138
- "calabash.js", (String) this.value,this.propertyName);
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.8
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-13 00:00:00.000000000 Z
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: '0'
864
+ version: 1.3.1
864
865
  requirements: []
865
866
  rubyforge_project:
866
867
  rubygems_version: 2.0.2