Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3683)

Unified Diff: chrome/test/data/extensions/api_test/file_manager_browsertest/suggest_app_dialog.js

Issue 304683002: Add the browser test for the new gallery. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/file_manager_browsertest/suggest_app_dialog.js
diff --git a/chrome/test/data/extensions/api_test/file_manager_browsertest/suggest_app_dialog.js b/chrome/test/data/extensions/api_test/file_manager_browsertest/suggest_app_dialog.js
deleted file mode 100644
index 5891d4072c7665c1712333c629699bd1e9bae8a6..0000000000000000000000000000000000000000
--- a/chrome/test/data/extensions/api_test/file_manager_browsertest/suggest_app_dialog.js
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-'use strict';
-
-/**
- * Tests sharing a file on Drive
- */
-testcase.suggestAppDialog = function() {
- var appId;
- StepsRunner.run([
- // Set up File Manager.
- function() {
- chrome.test.sendMessage(
- JSON.stringify({name: 'getCwsWidgetContainerMockUrl'}),
- this.next);
- },
- // Override the container URL with the mock.
- function(json) {
- var data = JSON.parse(json);
-
- var appState = {
- suggestAppsDialogState: {
- overrideCwsContainerUrlForTest: data.url,
- overrideCwsContainerOriginForTest: data.origin
- }
- };
- setupAndWaitUntilReady(appState, RootPath.DRIVE, this.next);
- },
- function(inAppId, inFileListBefore) {
- appId = inAppId;
-
- callRemoteTestUtil('selectFile', appId, ['unsupported.foo'], this.next);
- },
- // Double-click the file.
- function(result) {
- chrome.test.assertTrue(result);
- callRemoteTestUtil(
- 'fakeMouseDoubleClick',
- appId,
- ['#file-list li.table-row[selected] .filename-label span'],
- this.next);
- },
- // Wait for the widget is loaded.
- function(result) {
- chrome.test.assertTrue(result);
- waitForElement(appId, '#suggest-app-dialog webview[src]').then(this.next);
- },
- // Wait for the widget is initialized.
- function(result) {
- chrome.test.assertTrue(!!result);
- waitForElement(appId, '#suggest-app-dialog:not(.show-spinner)').
- then(this.next);
- },
- // Override task APIs for test.
- function(result) {
- chrome.test.assertTrue(!!result);
- callRemoteTestUtil(
- 'overrideTasks',
- appId,
- [[
- {
- driveApp: false,
- iconUrl: 'chrome://theme/IDR_DEFAULT_FAVICON', // Dummy icon
- isDefault: true,
- taskId: 'dummytaskid|drive|open-with',
- title: 'The dummy task for test'
- }
- ]],
- this.next);
- },
- // Override installWebstoreItem API for test.
- function(result) {
- chrome.test.assertTrue(!!result);
- callRemoteTestUtil(
- 'overrideInstallWebstoreItemApi',
- appId,
- [
- 'DUMMY_ITEM_ID_FOR_TEST', // Same ID in cws_container_mock/main.js.
- null // Success
- ],
- this.next);
- },
- // Initiate an installation from the widget.
- function(result) {
- chrome.test.assertTrue(!!result);
- callRemoteTestUtil(
- 'executeScriptInWebView',
- appId,
- ['#suggest-app-dialog webview',
- 'document.querySelector("button").click()'],
- this.next);
- },
- // Wait until the installation is finished and the dialog is closed.
- function(result) {
- chrome.test.assertTrue(!!result);
- waitForElementLost(appId, '#suggest-app-dialog').then(this.next);
- },
- // Wait until the task is executed.
- function(result) {
- chrome.test.assertTrue(!!result);
- waitUntilTaskExecutes(appId, 'dummytaskid|drive|open-with').
- then(this.next);
- },
- // Check error
- function() {
- checkIfNoErrorsOccured(this.next);
- }
- ]);
-};

Powered by Google App Engine
This is Rietveld 408576698