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

Side by Side Diff: webkit/tools/test_shell/notification_presenter.h

Issue 1549039: Enable support for notifications layout tests in test shell.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2010 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 #ifndef WEBKIT_TOOLS_TEST_SHELL_NOTIFICATION_PRESENTER_H_
6 #define WEBKIT_TOOLS_TEST_SHELL_NOTIFICATION_PRESENTER_H_
7
8 #include <set>
9 #include <string>
10
11 #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h"
12 #include "webkit/tools/test_shell/test_shell.h"
13
14 // A class that implements NotificationPresenter for the test shell.
15 class TestNotificationPresenter : public WebKit::WebNotificationPresenter {
16 public:
17 explicit TestNotificationPresenter(TestShell* shell)
18 : shell_(shell) {
19 }
20
21 // Called by the LayoutTestController to simulate a user granting
22 // permission.
23 void grantPermission(const std::string& origin);
24
25 // WebKit::WebNotificationPresenter interface
26 virtual bool show(const WebKit::WebNotification&);
27 virtual void cancel(const WebKit::WebNotification&);
28 virtual void objectDestroyed(const WebKit::WebNotification&);
29 virtual Permission checkPermission(const WebKit::WebURL& url);
30 virtual void requestPermission(const WebKit::WebSecurityOrigin& origin,
31 WebKit::WebNotificationPermissionCallback* callback);
32
33 void Reset() {
34 allowed_origins_.clear();
35 }
36
37 private:
38 // Non-owned pointer. The NotificationPresenter is owned by the test shell.
39 TestShell* shell_;
40
41 // List of allowed origins.
42 std::set<std::string> allowed_origins_;
43 };
44
45 #endif // WEBKIT_TOOLS_TEST_SHELL_NOTIFICATION_PRESENTER_H_
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/layout_test_controller.cc ('k') | webkit/tools/test_shell/notification_presenter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698