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

Side by Side Diff: chrome/test/data/extensions/api_test/notifications/has_permission_prefs/background.html

Issue 8763008: Move yet another block of 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
1 <script> 1 <!--
2 var notification = null; 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this
3 3 * source code is governed by a BSD-style license that can be found in the
4 // Shows the notification window using the specified URL. 4 * LICENSE file.
5 // Control continues at onNotificationDone(). 5 -->
6 function showNotification(url) { 6 <script src="background.js"></script>
7 notification = window.webkitNotifications.createHTMLNotification(url);
8 notification.onerror = function() {
9 chrome.test.fail("Failed to show notification.");
10 };
11 notification.show();
12 }
13
14 // Called by the notification when it is done with its tests.
15 function onNotificationDone(notificationWindow) {
16 var views = chrome.extension.getViews();
17 chrome.test.assertEq(2, views.length);
18 notificationWindow.onunload = function() {
19 chrome.test.succeed();
20 }
21 notification.cancel();
22 }
23
24 chrome.test.runTests([
25 function hasPermission() {
26 chrome.test.assertEq(0, // allowed
27 webkitNotifications.checkPermission());
28 chrome.test.succeed();
29 },
30 function absoluteURL() {
31 showNotification(chrome.extension.getURL("notification.html"));
32 },
33 function relativeURL() {
34 showNotification("notification.html");
35 }
36 ]);
37 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698