Commit db22bae6 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

Add autoStep helper to FileManager integration test extensions

Add autoStep() helper for step-by-step mode. Typing it at the devtools
console (or evaluating it in other remote inspection tools) causes all
the test steps to run automatically in step by step mode [1].

[1] out/Release/browser_tests --enable-file-manager-step-by-step-tests

Tbr: lucmult
Bug: 863800,836254
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: I5923f2ad0cc4fcc98e20e7bdf66e9ad504a4f9cf
Reviewed-on: https://chromium-review.googlesource.com/1137968Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575220}
parent b06141ec
...@@ -4,6 +4,19 @@ ...@@ -4,6 +4,19 @@
'use strict'; 'use strict';
/**
* When step by step tests are enabled, turns on automatic step() calls. Note
* that if step() is defined at the time of this call, invoke it to start the
* test auto-stepping ball rolling.
*/
function autoStep() {
window.autostep = window.autostep || false;
if (!autostep)
autostep = true;
if (autostep && typeof window.step == 'function')
window.step();
}
/** /**
* Class to manipulate the window in the remote extension. * Class to manipulate the window in the remote extension.
* *
...@@ -45,11 +58,16 @@ RemoteCall.prototype.callRemoteTestUtil = ...@@ -45,11 +58,16 @@ RemoteCall.prototype.callRemoteTestUtil =
return new Promise(function(onFulfilled) { return new Promise(function(onFulfilled) {
console.info('Executing: ' + func + ' on ' + appId + ' with args: '); console.info('Executing: ' + func + ' on ' + appId + ' with args: ');
console.info(args); console.info(args);
console.info('Type step() to continue...'); if (window.autostep !== true) {
window.step = function() { console.info('Type step() to continue...');
window.step = null; window.step = function() {
window.step = null;
onFulfilled(stepByStep);
};
} else {
console.info('Auto calling step() ...');
onFulfilled(stepByStep); onFulfilled(stepByStep);
}; }
}); });
}).then(function(stepByStep) { }).then(function(stepByStep) {
return new Promise(function(onFulfilled) { return new Promise(function(onFulfilled) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment