File tree 2 files changed +12
-7
lines changed
server/src/main/java/org/uiautomation/ios/mobileSafari
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -71,10 +71,10 @@ private void process(String rawMessage) {
71
71
responses .add (message );
72
72
return ;
73
73
}
74
+
74
75
// not null, not a command response.
75
76
// should be an event.
76
77
Event e = EventFactory .createEvent (message );
77
-
78
78
if (isPageLoad (message )) {
79
79
listener .onPageLoad ();
80
80
return ;
@@ -106,7 +106,7 @@ private boolean isImportantDOMChange(Event e) {
106
106
107
107
private boolean isPageLoad (JSONObject message ) {
108
108
String method = message .optString ("method" );
109
- return "Page.loadEventFired" .equals (method );
109
+ return "Page.loadEventFired" .equals (method ); // || "Profiler.resetProfiles".equals(method);
110
110
// return "Profiler.resetProfiles".equals(method) ||
111
111
// "DOM.documentUpdated".equals(method);
112
112
}
Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ public static String loadFromTemplate(String templatePath) {
41
41
return cacheTemplate ;
42
42
}
43
43
44
- InputStream is = Thread .currentThread ().getContextClassLoader ().getResourceAsStream (templatePath );
44
+ InputStream
45
+ is =
46
+ Thread .currentThread ().getContextClassLoader ().getResourceAsStream (templatePath );
45
47
if (is == null ) {
46
48
throw new WebDriverException ("cannot load : " + templatePath );
47
49
}
@@ -55,8 +57,7 @@ public static String loadFromTemplate(String templatePath) {
55
57
return content ;
56
58
}
57
59
58
-
59
-
60
+
60
61
public String JSONCommand (JSONObject command ) throws IOException {
61
62
String json = command .toString ();
62
63
String s = Base64 .encodeBase64String (json .getBytes ());
@@ -72,7 +73,11 @@ public byte[] plistXmlToBinary(String msg) throws Exception {
72
73
}
73
74
74
75
public String plistBinaryToXml (byte [] binary ) throws Exception {
75
- NSObject object = BinaryPropertyListParser .parse (binary );
76
- return object .toXMLPropertyList ();
76
+ try {
77
+ NSObject object = BinaryPropertyListParser .parse (binary );
78
+ return object .toXMLPropertyList ();
79
+ } catch (Exception e ) {
80
+ return null ;
81
+ }
77
82
}
78
83
}
You can’t perform that action at this time.
0 commit comments