Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1EC5517448 for ; Wed, 28 Jan 2015 18:53:37 +0000 (UTC) Received: (qmail 1889 invoked by uid 500); 28 Jan 2015 18:53:37 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 1852 invoked by uid 500); 28 Jan 2015 18:53:37 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 1831 invoked by uid 99); 28 Jan 2015 18:53:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jan 2015 18:53:36 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bowserj@gmail.com designates 209.85.213.177 as permitted sender) Received: from [209.85.213.177] (HELO mail-ig0-f177.google.com) (209.85.213.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jan 2015 18:53:32 +0000 Received: by mail-ig0-f177.google.com with SMTP id z20so12930968igj.4 for ; Wed, 28 Jan 2015 10:51:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:from:date:message-id:subject:to :content-type; bh=2VTP72GWzApGz1fFUfsXrcX4sqyI7yG6ndpdIkydV9k=; b=Evexg3LELZ8Jrc+GFFSSKAgBWbplCHFKtGgD2V4wXCGPUjjXG+vs3Vu5wNdjcY5G24 DNEnGhZqxqG9PTmXFQp/ssnkJHwTdSr04r8Qkp5fH+aLYDC0AxavjlWyJ8JPd7WWNwPE PYFb/aP55X+tpnr0kTTHZuGSc1HfgNjo/xo/da6dmlMdD479tYvVclwAz9pq6G4UWYMx aA7MAD+sbp5L18f+XP3sQi1KFu8wvqTZwewKvPD0qBfk6pHvA6gV1pmD721bLRk3D2Pc Lib9qJSMVnhgHcO2wAu8SaNkyTGq/AtuR4IpCU7uHWbHyQOqRffRlfSEXWjshaKUVBHn J/Gg== X-Received: by 10.50.61.201 with SMTP id s9mr5440435igr.0.1422471102318; Wed, 28 Jan 2015 10:51:42 -0800 (PST) MIME-Version: 1.0 References: <1298B14A1D0704468AE73FC92557A162257EFC7D@SHSMSX104.ccr.corp.intel.com> From: Joe Bowser Date: Wed, 28 Jan 2015 18:51:41 +0000 Message-ID: Subject: Re: cordova-android 4.0 JUnit tests To: dev@cordova.apache.org Content-Type: multipart/alternative; boundary=047d7bdc162ec1d211050dbadca8 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bdc162ec1d211050dbadca8 Content-Type: text/plain; charset=UTF-8 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 View > (probably AbsoluteLayout), and then you wouldn't have to change anything at > all, and the XML inflation would work with either engine. > > This still doesn't fix the problem. If CordovaWebView extends view, what does AndroidWebView or MozillaWebView extend? They're both currently extending WebView and GeckoView respectively. This also means that the embedding code would have to completely change and would be even more incompatible than the interface approach. > On Wed, Jan 28, 2015 at 1:25 PM, Joe Bowser wrote: > > > 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 container or any other thing. > > > > 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. > > > > On Wed Jan 28 2015 at 10:07:18 AM Andrew Grieve > > wrote: > > > > > 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 28, 2015 at 11:26 AM, Joe Bowser > wrote: > > > > > > > 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 > > > > of implementations. If we didn't already have users embedding > > > > CordovaWebView (and seriously guys, if you're reading this, please > > don't > > > > keep leaving me hanging here, I want you to step up into this > > > > conversation). Also, other views, such as the prototype MozillaView > > > that I > > > > worked on, are implemented so that they inherit from a view. > > > > > > > > Just because it may offer some us some flexibility doesn't mean that > > it's > > > > worth taking away an entire feature from other users. My most > popular > > > > repository after Cordova itself is the example where I show how to > > embed > > > a > > > > CordovaWebView, so people have been using this feature. > > > > > > > > On Wed Jan 28 2015 at 6:49:18 AM Andrew Grieve > > > > > wrote: > > > > > > > > > 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 < > ningxin.hu@intel.com> > > > > > wrote: > > > > > > > > > > > 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 because of this > > > > > > incompatibility. > > > > > > > I don't think there is a way to re-use these tests because of > > this > > > > > > fundamental > > > > > > > change. > > > > > > > > > > > > Crosswalk main class (XWalkView) actually inherits from a view > (via > > > > > > FrameLayout). See > > > > > > https://crosswalk-project.org/apis/embeddingapidocs_v3/ > index.html > > > > > > > > > > > > I inspected the commit that changed the XWalkCordovaWebView from > > > > > > inheritance to composition ( > > > > > > > > https://github.com/MobileChromeApps/cordova-crosswalk-engine/commit/ > > > > > 26029ce8ae6d651a44a90222514cc6902ef8bb4a). > > > > > > The reason was some APIs of CordovaWebView interface (e.g. > > CanGoBack) > > > > > > conflict with XWalkView internal implementation at that time. > And I > > > > > > remembered Ian and me thought CordovaWebView as an interface and > > > > > > compositing of webview probably was a good decouple solution. > > > > > > > > > > > > However, this changed in Crosswalk embedding API 3 (current > > version) > > > > that > > > > > > we separated the public interface and implementation. I briefly > > > checked > > > > > > that the inheritance approach works with Crosswalk webview now. > > > > > > > > > > > > Folks, do you think we need to align all webview engines to > > > inheritance > > > > > > pattern? > > > > > > > > > > > > Thanks, > > > > > > -ningxin > > > > > > > > > > > > > On Tue Jan 20 2015 at 5:11:54 AM Fu, Junwei < > junwei.fu@intel.com > > > > > > > > wrote: > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > I pulled cordova-android 4.0 branch, and running JUnit test > in > > > > /test > > > > > > > > directory, but there are compiled error as below, and I want > > > reuse > > > > > the > > > > > > > > JUnit tests to test Crosswalk pluggable webView, so I > request > > a > > > PR > > > > > > > > https://github.com/apache/cordova-android/pull/140, could > > > someone > > > > > > > help > > > > > > > > me to review and merge it. > > > > > > > > > > > > > > > > /test/menus.java:37: error: method registerForContextMenu in > > > class > > > > > > > > Activity cannot be applied to given types; > > > > > > > > [javac] > > super.registerForContextMenu(super.appView); > > > > > > > > reason: actual argument CordovaWebView cannot be converted to > > > View > > > > > > > by > > > > > > > > method invocation conversion > > > > > > > > > > > > > > > > test/splashscreen.java:33: error: method loadUrl in class > > > > > > > > CordovaActivity cannot be applied to given types; > > > > > > > > [javac] > > > > > > > > > super.loadUrl("file:///android_asset/www/splashscreen/index.html", > > > > > > > > 2000); > > > > > > > > reason: actual and formal argument lists differ in length > > > > > > > > > > > > > > > > Thanks, > > > > > > > > Junwei. > > > > > > > > > > > > > > > > ------------------------------------------------------------ > > > > > --------- > > > > > > > > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org > > > > > > > > For additional commands, e-mail: dev-help@cordova.apache.org > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --047d7bdc162ec1d211050dbadca8--