Skip to content

Commit

Permalink
Don't run AndroidTracingProbe for Cordova apps
Browse files Browse the repository at this point in the history
AndroidTracingProbe looks for adb logs that are triggered only for Chrome-Android.
All other Chrome WebView apps, including Cordova apps cannot use that.

In AndroidTracingProbe, the capabilities were picked up from the browser session rather than than what was passed in.
As a result, the lines (that were deleted in this commit) simply passed, causing this to be called even for Cordova apps.

As a result, the logs never show up, waitForLogCat timeout and browser-perf failed.

The check in this commit basically says that ALL Chrome-Android browser have an activity, and that should be the only time when AndroidTracingProbe should be triggered.

See #61
  • Loading branch information
axemclion committed May 24, 2016
1 parent d4dc906 commit 6047766
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/probes/AndroidTracingProbe.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@ util.inherits(AndroidTracingProbe, events.EventEmitter);
AndroidTracingProbe.prototype.id = 'AndroidTracingProbe';

AndroidTracingProbe.prototype.isEnabled = function(browser) {
// Called when setup method gets Caps from server
if (browser.platform && browser.platform.match(/android/i)) {
if (browser.browserName && browser.browserName.match(/chrome/i) && parseInt(browser.version, 10) >= 33) {
return true;
}
}

// TRUE for Android Chrome browser
// TRUE for Android Chrome browser - Activity Name is always set for Android-Chrome browser
if (helpers.deepEquals(browser, 'browserName', 'android') && helpers.deepEquals(browser, 'chromeOptions.androidPackage', 'com.android.chrome')) {
return true;
}
Expand Down

0 comments on commit 6047766

Please sign in to comment.