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

Side by Side Diff: LayoutTests/webintents/resources/web-intents-testing.js

Issue 9949021: Merge 113282 - Switch web intents API to be vendor-prefixed (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 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
OLDNEW
1 // Callback function to be used for a successful web intent call. 1 // Callback function to be used for a successful web intent call.
2 function onSuccess(data) { 2 function onSuccess(data) {
3 debug("* got reply: " + data); 3 debug("* got reply: " + data);
4 4
5 if (window.layoutTestController) { 5 if (window.layoutTestController) {
6 window.layoutTestController.notifyDone(); 6 window.layoutTestController.notifyDone();
7 } 7 }
8 } 8 }
9 9
10 // Callback function to be used for a failed web intent call. 10 // Callback function to be used for a failed web intent call.
11 function onFailure(data) { 11 function onFailure(data) {
12 debug("* got failure: " + data); 12 debug("* got failure: " + data);
13 13
14 if (window.layoutTestController) { 14 if (window.layoutTestController) {
15 window.layoutTestController.notifyDone(); 15 window.layoutTestController.notifyDone();
16 } 16 }
17 } 17 }
18 18
19 // Launch a web intent call with callbacks. 19 // Launch a web intent call with callbacks.
20 function startIntentWithCallbacks() { 20 function startIntentWithCallbacks() {
21 navigator.startActivity(new Intent("action1", "mime/type1", "test"), onSuccess , onFailure); 21 navigator.webkitStartActivity(new WebKitIntent("action1", "mime/type1", "test" ), onSuccess, onFailure);
22 debug("* sent intent"); 22 debug("* sent intent");
23 23
24 if (window.layoutTestController) { 24 if (window.layoutTestController) {
25 window.layoutTestController.waitUntilDone(); 25 window.layoutTestController.waitUntilDone();
26 } else { 26 } else {
27 alert('This test needs to run in DRT'); 27 alert('This test needs to run in DRT');
28 } 28 }
29 } 29 }
30 30
31 // This button press simulator sets the user gesture indicator that an intent 31 // This button press simulator sets the user gesture indicator that an intent
32 // requires to start. 32 // requires to start.
33 function simulateButtonPress() { 33 function simulateButtonPress() {
34 var button = document.getElementById("button"); 34 var button = document.getElementById("button");
35 if (eventSender) { 35 if (eventSender) {
36 eventSender.mouseMoveTo(button.getBoundingClientRect().left + 2, button.getB oundingClientRect().top + 12); 36 eventSender.mouseMoveTo(button.getBoundingClientRect().left + 2, button.getB oundingClientRect().top + 12);
37 eventSender.mouseDown(); 37 eventSender.mouseDown();
38 eventSender.mouseUp(); 38 eventSender.mouseUp();
39 } 39 }
40 } 40 }
OLDNEW
« no previous file with comments | « LayoutTests/webintents/resources/web-intents-reload-orig.html ('k') | LayoutTests/webintents/web-intents-api.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698