Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6489] Android: Only set basic auth on web view if the proxy is of type WebViewProxy

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2011-12-08T23:49:58.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2011-49, Release 1.8.0.1
ComponentsAndroid
Labelsmodule_webview, qe-testadded
ReporterOpie Cyrus
AssigneeAllen Yeung
Created2011-12-06T13:41:23.000+0000
Updated2012-01-10T15:07:18.000+0000

Description

Crash from modules when trying to extend web view. Web view takes a TiViewProxy but assumes further in that the type is WebViewProxy. Wrap basic auth logic in instanceof check for WebViewProxy. Pastie of working work around attached: http://pastie.org/2977192

Attachments

FileDateSize
ti.sample-android-2.zip2012-01-10T14:52:41.000+000040508

Comments

  1. Allen Yeung 2011-12-08

    Steps to reproduce: 1. Create a titanium project 2. Open tiapp.xml and add entry:
           <modules>
               <module>ti.sample</module>
           </modules>
       
    3. Download attached zipped module, and place it in your project (same level as the Resources directory) 4. Use the following app.js:
       var window = Ti.UI.createWindow({
       	backgroundColor:'white'
       });
       var label = Ti.UI.createLabel();
       window.add(label);
       window.open();
       
       var webview = require('ti.sample');
       Ti.API.info("module is => " + webview);
       
       label.text = webview.example();
       
       Ti.API.info("module exampleProp is => " + webview.exampleProp);
       webview.exampleProp = "This is a test value";
       
       if (Ti.Platform.name == "android") {
       	var proxy = webview.createExample({
       		message: "Creating an example Proxy",
       		backgroundColor: "red",
       		width: 100,
       		height: 100,
       		top: 100,
       		left: 150
       	});
       
       	proxy.printMessage("Hello world!");
       	proxy.message = "Hi world!.  It's me again.";
       	proxy.printMessage("Hello world!");
       	window.add(proxy);
       }
       
    5. Run the app (NOTE: if you run the app multiple times you may need to clean out build directory each time) The app will crash and stay on the splash screen in the fail case.
  2. Michael Pettiford 2012-01-10

    Closing issue Tested with Ti Studio 1.0.8.201201091758 Ti Mob SDK 1.8.0.1 OSX Lion Droid 3 both v8 and rhino Expected behavior is shown

JSON Source