This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8714 from jaoo/852537
Bug 852537 - [Settings] Create performance test for the WiFi network lis...
- Loading branch information
Showing
5 changed files
with
87 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
|
||
require('/tests/js/app_integration.js'); | ||
require('/tests/js/integration_helper.js'); | ||
|
||
function SettingsIntegration(device) { | ||
AppIntegration.apply(this, arguments); | ||
} | ||
|
||
SettingsIntegration.prototype = { | ||
__proto__: AppIntegration.prototype, | ||
appName: 'Settings', | ||
manifestURL: 'app://settings.gaiamobile.org/manifest.webapp', | ||
|
||
selectors: { | ||
wifiSelector: '#menuItem-wifi' | ||
} | ||
}; |
48 changes: 48 additions & 0 deletions
48
apps/settings/test/performance/rendering_wifi_list_test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
'use strict'; | ||
|
||
requireCommon('test/synthetic_gestures.js'); | ||
require('/tests/performance/performance_helper.js'); | ||
require('apps/settings/test/integration/app.js'); | ||
|
||
suite(window.mozTestInfo.appPath + ' >', function() { | ||
var device; | ||
var app; | ||
|
||
MarionetteHelper.start(function(client) { | ||
app = new SettingsIntegration(client); | ||
device = app.device; | ||
}); | ||
|
||
setup(function() { | ||
// It affects the first run otherwise | ||
yield IntegrationHelper.unlock(device); | ||
}); | ||
|
||
test('rendering WiFi list >', function() { | ||
this.timeout(500000); | ||
yield device.setScriptTimeout(50000); | ||
|
||
var lastEvent = 'settings-panel-wifi-ready'; | ||
|
||
var performanceHelper = new PerformanceHelper({ | ||
app: app, | ||
lastEvent: lastEvent | ||
}); | ||
|
||
yield performanceHelper.repeatWithDelay(function(app, next) { | ||
var waitForBody = true; | ||
yield app.launch(waitForBody); | ||
|
||
var wifiSubpanel = yield app.element('wifiSelector'); | ||
yield wifiSubpanel.singleTap(); | ||
|
||
var runResults = yield performanceHelper.observe(next); | ||
performanceHelper.reportRunDurations(runResults); | ||
|
||
yield app.close(); | ||
}); | ||
|
||
performanceHelper.finish(); | ||
|
||
}); | ||
}); |