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

Side by Side Diff: chrome/test/data/extensions/api_test/filesystem_handler/background.js

Issue 8758008: Move another block of extension tests to manifest_version 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var last_file_entries = null;
6
7 function getLastFileEntries() {
8 return last_file_entries;
9 }
10
11 function executeListener(id, details) {
12 if (id != "TextAction" && id != "BaseAction" && id != "JpegAction") {
13 chrome.test.fail("Unexpected action id: " + id);
14 return;
15 }
16 var file_entries = details.entries;
17 if (!file_entries || file_entries.length != 1) {
18 chrome.test.fail("Unexpected file url list");
19 return;
20 }
21 last_file_entries = file_entries;
22 chrome.tabs.get(details.tab_id, function(tab) {
23 if (tab.title != "file browser component test") {
24 chrome.test.fail("Unexpected tab title: " + tab.title);
25 return;
26 }
27 // Create a new tab
28 chrome.tabs.create({
29 url: "tab.html"
30 });
31 });
32 }
33
34 chrome.fileBrowserHandler.onExecute.addListener(executeListener);
35
36 // This extension just initializes its chrome.fileBrowserHandler.onExecute
37 // event listener, the real testing is done when this extension's handler is
38 // invoked from filebrowser_component tests. This event will be raised from that
39 // component extension test and it simulates user action in the file browser.
40 // tab.html part of this extension can run only after the component raises this
41 // event, since that operation sets the propery security context and creates
42 // event's payload with proper file Entry instances. tab.html will return
43 // results of its execution to filebrowser_component test through a
44 // cross-component message.
45 chrome.test.succeed();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698