RE: cordova-android 4.0 JUnit tests

2015-02-03 Thread Hu, Ningxin
Hi Joe, > > OK, and how do you set that up so that it has the Cordova APIs? > This code is from Crosswalk shell which does nothing with Cordova API. However, crosswalk downstream fork of cordova-android is using inheritance as: https://github.com/crosswalk-project/crosswalk-cordova-android/blo

Re: cordova-android 4.0 JUnit tests

2015-02-03 Thread Joe Bowser
OK, and how do you set that up so that it has the Cordova APIs? On Mon Feb 02 2015 at 9:51:55 PM Hu, Ningxin wrote: > Hi Joe, > > > That's part of it. What's the setup code for that look like? > > https://github.com/crosswalk-project/crosswalk/blob/master/ > runtime/android/core_shell/src/org/x

RE: cordova-android 4.0 JUnit tests

2015-02-02 Thread Hu, Ningxin
Hi Joe, > That's part of it. What's the setup code for that look like? https://github.com/crosswalk-project/crosswalk/blob/master/runtime/android/core_shell/src/org/xwalk/core/xwview/shell/XWalkViewSectionFragment.java#L40 Thanks, -ningxin > > On Wed Jan 28 2015 at 7:15:10 PM Hu, Ningxin > w

Re: cordova-android 4.0 JUnit tests

2015-01-28 Thread Joe Bowser
That's part of it. What's the setup code for that look like? On Wed Jan 28 2015 at 7:15:10 PM Hu, Ningxin wrote: > Hi Joe, > > > > I have never seen an example of Crosswalk using Android XML layouts, and > > as far as I'm currently aware, embedding Crosswalk is less > straightforward > > than e

RE: cordova-android 4.0 JUnit tests

2015-01-28 Thread Hu, Ningxin
Hi Joe, > > I have never seen an example of Crosswalk using Android XML layouts, and > as far as I'm currently aware, embedding Crosswalk is less straightforward > than embedding AndroidWebView or MozillaWebView. > Is this what you are looking for? https://github.com/crosswalk-project/crosswalk

Re: cordova-android 4.0 JUnit tests

2015-01-28 Thread Joe Bowser
On Wed Jan 28 2015 at 10:42:46 AM Andrew Grieve wrote: > I think we're talking about the same thing. > > You can have an XWalkCordovaView within a layout, and then attach > a XWalkCordovaWebView to it in code afterwards. > > What might be even better though, is if we made CordovaWebView extend Vi

Re: cordova-android 4.0 JUnit tests

2015-01-28 Thread Andrew Grieve
I think we're talking about the same thing. You can have an XWalkCordovaView within a layout, and then attach a XWalkCordovaWebView to it in code afterwards. What might be even better though, is if we made CordovaWebView extend View (probably AbsoluteLayout), and then you wouldn't have to change

Re: cordova-android 4.0 JUnit tests

2015-01-28 Thread Joe Bowser
What is your definition of embedding a view? I think we're talking about two different things. What I'm talking about is being able to embed AndroidWebView as an embedded view without having to change any code other than the name of the class. This means that you don't have to worry about the con

Re: cordova-android 4.0 JUnit tests

2015-01-28 Thread Andrew Grieve
You can still embed a view using composition. We are not providing any backwards compatibility right now, even with inheritance, because CordovaWebView is no longer a View (it's an interface, which requires an explicit cast to (View), or a call to .getView() to be considered as a View) On Wed, Jan

Re: cordova-android 4.0 JUnit tests

2015-01-28 Thread Joe Bowser
I completely disagree, and think we should go the inheritance pattern. The reason for that is that we have to provide backwards compatibility for some views where the implementation is a view, and there's no dual inheritance in Java, which is the only way that I can see us accommodating both types

Re: cordova-android 4.0 JUnit tests

2015-01-28 Thread Andrew Grieve
I'd prefer to go the other way, and change AndroidWebView to composition. It's more flexible and does a better job of splitting up groups of APIs. On Wed, Jan 28, 2015 at 12:49 AM, Hu, Ningxin wrote: > Hi Joe, > > > > The tests don't work with Crosswalk because Crosswalk's main class > doesn't >

RE: cordova-android 4.0 JUnit tests

2015-01-27 Thread Hu, Ningxin
Hi Joe, > > The tests don't work with Crosswalk because Crosswalk's main class doesn't > inherit from a view. This is why we had to change the CordovaWebView > from being a class to being an Interface in the first place. I don't think > there is > a way for these tests to work with Crosswalk be

RE: cordova-android 4.0 JUnit tests

2015-01-21 Thread Fu, Junwei
Thank you so much for supporting positively Crosswalk into JUnit tests. -Original Message- From: agri...@google.com [mailto:agri...@google.com] On Behalf Of Andrew Grieve Sent: Wednesday, January 21, 2015 10:46 PM To: dev Subject: Re: cordova-android 4.0 JUnit tests On Wed, Jan 21, 2015

Re: cordova-android 4.0 JUnit tests

2015-01-21 Thread Andrew Grieve
lf Of Andrew > Grieve > Sent: Wednesday, January 21, 2015 4:01 AM > To: Andrew Grieve > Cc: dev > Subject: Re: cordova-android 4.0 JUnit tests > > Also - maybe leave the inflate test using AndroidWebView, and make the > other ones create dynamically? > > On Tue, Jan 2

RE: cordova-android 4.0 JUnit tests

2015-01-21 Thread Fu, Junwei
ogle.com] On Behalf Of Andrew Grieve Sent: Wednesday, January 21, 2015 4:01 AM To: Andrew Grieve Cc: dev Subject: Re: cordova-android 4.0 JUnit tests Also - maybe leave the inflate test using AndroidWebView, and make the other ones create dynamically? On Tue, Jan 20, 2015 at 2:59 PM, Andrew Gr

Re: cordova-android 4.0 JUnit tests

2015-01-20 Thread Andrew Grieve
Also - maybe leave the inflate test using AndroidWebView, and make the other ones create dynamically? On Tue, Jan 20, 2015 at 2:59 PM, Andrew Grieve wrote: > gotcha. I've now got tests building & running with gradle (painful > learning curve...). I'm going to pull in the changes from this PR tha

Re: cordova-android 4.0 JUnit tests

2015-01-20 Thread Andrew Grieve
gotcha. I've now got tests building & running with gradle (painful learning curve...). I'm going to pull in the changes from this PR that fix the compile, but will leave the rest. Junwei - do the tests pass for you? I certainly can't get most of them to (running on KitKat) :( On Tue, Jan 20, 2015

Re: cordova-android 4.0 JUnit tests

2015-01-20 Thread Joe Bowser
It's an issue because this test was supposed to be testing the embedding of a WebView via layout. That's why the inflate exists in the code. By creating the webview directly, it's not actually testing anything of value. We actually lose test coverage with this change. On Tue Jan 20 2015 at 9:5

Re: cordova-android 4.0 JUnit tests

2015-01-20 Thread Andrew Grieve
Nice. I've got a gradle file that now at least builds the application, so not far off of having it run the tests. Totally on board with re-writing the unit tests (they have an unfortunate number of Thread.sleep() in them). But this PR at least makes them compile on 4.0.x. Maybe add some comments t

Re: cordova-android 4.0 JUnit tests

2015-01-20 Thread Joe Bowser
It was easier to get the tests to run in Android Studio than it was to get Cordova itself to run. You just import them in as an Eclipse project and it just works. I was surprised when I did this a few days ago. I don't like this pull request because it removes all tests of the AndroidWebView comp

Re: cordova-android 4.0 JUnit tests

2015-01-20 Thread Andrew Grieve
I think Junwei is saying that he has got them to work in his PR. I looked at this a while ago, but couldn't figure out how to get the tests to run in the Android Studio / Gradle world. I'll have another crack at it. On Tue, Jan 20, 2015 at 8:37 AM, Joe Bowser wrote: > The tests don't work with

Re: cordova-android 4.0 JUnit tests

2015-01-20 Thread Joe Bowser
The tests don't work with Crosswalk because Crosswalk's main class doesn't inherit from a view. This is why we had to change the CordovaWebView from being a class to being an Interface in the first place. I don't think there is a way for these tests to work with Crosswalk because of this incompat