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

Side by Side Diff: chrome/test/data/extensions/api_test/offscreen_tabs/keyboard_events.js

Issue 9796012: Revert 127833 - Re-land alexbost's experimental offscreenTabs API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 testTab = { url: 'a.html', width: 200, height: 200 };
6 var testTabId;
7
8 chrome.test.runTests([
9 function init() {
10 chrome.test.listenOnce(
11 chrome.experimental.offscreenTabs.onUpdated,
12 function(tabId, changeInfo, tab) {
13 assertSimilarTabs(testTab, tab);
14 });
15
16 chrome.experimental.offscreenTabs.create(testTab, pass(function(tab) {
17 assertSimilarTabs(testTab, tab);
18 testTabId = tab.id;
19 }));
20 },
21
22 // Test that keyboard events work by sending a 'q' keypress to a.html. The
23 // page has a keypress handler that will navigate the page to c.html.
24 function keyPress() {
25 chrome.test.listenOnce(
26 chrome.experimental.offscreenTabs.onUpdated,
27 function(tabId, changeInfo, tab) {
28 testTab.url = 'c.html';
29 assertEq(maybeExpandURL('c.html'), changeInfo.url);
30 assertSimilarTabs(testTab, tab);
31 assertEq(tabId, tab.id);
32 assertEq(tabId, testTabId);
33 });
34
35 chrome.experimental.offscreenTabs.sendKeyboardEvent(
36 testTabId, getKeyboardEvent(Q_KEY), pass(function() {
37 chrome.experimental.offscreenTabs.get(testTabId, pass(function(tab) {
38 assertSimilarTabs(testTab, tab);
39 }));
40 }));
41 }
42
43 // TODO(jstritar): Test event validation and edge cases.
44 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698