| Index: chrome/test/data/extensions/api_test/file_manager_browsertest/gallery/test_util.js
|
| diff --git a/chrome/test/data/extensions/api_test/file_manager_browsertest/gallery/test_util.js b/chrome/test/data/extensions/api_test/file_manager_browsertest/gallery/test_util.js
|
| index 25c7f3b6e8d966decafd996674a7a65256a73398..c1bdb354057fccb141ead53afaf122c5bcc2e0bf 100644
|
| --- a/chrome/test/data/extensions/api_test/file_manager_browsertest/gallery/test_util.js
|
| +++ b/chrome/test/data/extensions/api_test/file_manager_browsertest/gallery/test_util.js
|
| @@ -5,65 +5,6 @@
|
| 'use strict';
|
|
|
| /**
|
| - * Gets file entries just under the volume.
|
| - *
|
| - * @param {VolumeManagerCommon.VolumeType} volumeType Volume type.
|
| - * @param {Array.<string>} names File name list.
|
| - * @return {Promise} Promise to be fulflled with Array.<FileEntry>.
|
| - */
|
| -function getFilesUnderVolume(volumeType, names) {
|
| - var displayRootPromise = backgroundComponentsPromise.then(
|
| - function(backgroundComponent) {
|
| - var volumeManager = backgroundComponent.volumeManager;
|
| - var volumeInfo = volumeManager.getCurrentProfileVolumeInfo(volumeType);
|
| - return new Promise(function(fulfill, reject) {
|
| - volumeInfo.resolveDisplayRoot(fulfill, reject);
|
| - });
|
| - });
|
| - return displayRootPromise.then(function(displayRoot) {
|
| - var filesPromise = names.map(function(name) {
|
| - return new Promise(
|
| - displayRoot.getFile.bind(displayRoot, name, {}));
|
| - });
|
| - return Promise.all(filesPromise);
|
| - });
|
| -}
|
| -
|
| -/**
|
| - * Waits until an element appears and returns it.
|
| - *
|
| - * @param {AppWindow} appWindow Application window.
|
| - * @param {string} query Query for the element.
|
| - * @return {Promise} Promise to be fulfilled with the element.
|
| - */
|
| -function waitForElement(appWindow, query) {
|
| - return repeatUntil(function() {
|
| - var element = appWindow.contentWindow.document.querySelector(query);
|
| - if (element)
|
| - return element;
|
| - else
|
| - return pending('The element %s is not found.', query);
|
| - });
|
| -}
|
| -
|
| -/**
|
| - * Waits until an element disappears.
|
| - *
|
| - * @param {AppWindow} appWindow Application window.
|
| - * @param {string} query Query for the element.
|
| - * @return {Promise} Promise to be fulfilled with the element.
|
| - */
|
| -function waitForElementLost(appWindow, query) {
|
| - return repeatUntil(function() {
|
| - var element = appWindow.contentWindow.document.querySelector(query);
|
| - if (element)
|
| - return pending('The element %s does not disappear.', query);
|
| - else
|
| - return true;
|
| - });
|
| -}
|
| -
|
| -/**
|
| * Launches the Gallery app with the test entries.
|
| *
|
| * @param {string} testVolumeName Test volume name passed to the addEntries
|
| @@ -82,6 +23,7 @@ function launchWithTestEntries(
|
| volumeType,
|
| selectedEntries.map(function(entry) { return entry.nameText; }));
|
| });
|
| +
|
| return launch(entriesPromise).then(function() {
|
| var launchedPromise = Promise.all([appWindowPromise, entriesPromise]);
|
| return launchedPromise.then(function(results) {
|
| @@ -117,41 +59,3 @@ function waitForSlideImage(document, width, height, name) {
|
| return actual;
|
| });
|
| }
|
| -
|
| -/**
|
| - * Shorthand for clicking an element.
|
| - * @param {AppWindow} appWindow Application window.
|
| - * @param {string} query Query for the element.
|
| - * @param {Promise} Promise to be fulfilled with the clicked element.
|
| - */
|
| -function waitAndClickElement(appWindow, query) {
|
| - return waitForElement(appWindow, query).then(function(element) {
|
| - element.click();
|
| - return element;
|
| - });
|
| -}
|
| -
|
| -/**
|
| - * Sends a fake key down event.
|
| - *
|
| - * @param {AppWindow} appWindow Application window.
|
| - * @param {string} query Query for the element to be dispatched an event to.
|
| - * @param {string} keyIdentifier Key identifier.
|
| - * @return {boolean} True on success.
|
| - */
|
| -function sendKeyDown(appWindow, query, keyIdentifier) {
|
| - return appWindow.contentWindow.document.querySelector(query).dispatchEvent(
|
| - new KeyboardEvent(
|
| - 'keydown',
|
| - {bubbles: true, keyIdentifier: keyIdentifier}));
|
| -}
|
| -
|
| -/**
|
| - * Observes window errors that should fail the browser tests.
|
| - * @param {DOMWindow} window Windows to be obserbed.
|
| - */
|
| -function observeWindowError(window) {
|
| - window.onerror = function(error) {
|
| - chrome.test.fail('window.onerror: ' + error);
|
| - };
|
| -}
|
|
|