OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
6 #include "base/threading/platform_thread.h" | 6 #include "base/threading/platform_thread.h" |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "chrome/browser/notifications/notification_test_util.h" | 8 #include "chrome/browser/notifications/notification_test_util.h" |
9 #include "chrome/browser/notifications/platform_notification_service_impl.h" | 9 #include "chrome/browser/notifications/platform_notification_service_impl.h" |
10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 public: | 47 public: |
48 MockDesktopNotificationDelegate() | 48 MockDesktopNotificationDelegate() |
49 : displayed_(false), | 49 : displayed_(false), |
50 clicked_(false) {} | 50 clicked_(false) {} |
51 | 51 |
52 ~MockDesktopNotificationDelegate() override {} | 52 ~MockDesktopNotificationDelegate() override {} |
53 | 53 |
54 // content::DesktopNotificationDelegate implementation. | 54 // content::DesktopNotificationDelegate implementation. |
55 void NotificationDisplayed() override { displayed_ = true; } | 55 void NotificationDisplayed() override { displayed_ = true; } |
56 void NotificationClosed() override {} | 56 void NotificationClosed() override {} |
57 void NotificationClick() override { clicked_ = true; } | 57 void NotificationClick(int action_index) override { clicked_ = true; } |
58 | 58 |
59 bool displayed() const { return displayed_; } | 59 bool displayed() const { return displayed_; } |
60 bool clicked() const { return clicked_; } | 60 bool clicked() const { return clicked_; } |
61 | 61 |
62 private: | 62 private: |
63 bool displayed_; | 63 bool displayed_; |
64 bool clicked_; | 64 bool clicked_; |
65 }; | 65 }; |
66 | 66 |
67 } // namespace | 67 } // namespace |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 // Verify that the service indicates that permission has been granted. We only | 347 // Verify that the service indicates that permission has been granted. We only |
348 // check the UI thread-method for now, as that's the one guarding the behavior | 348 // check the UI thread-method for now, as that's the one guarding the behavior |
349 // in the browser process. | 349 // in the browser process. |
350 EXPECT_EQ(blink::WebNotificationPermissionAllowed, | 350 EXPECT_EQ(blink::WebNotificationPermissionAllowed, |
351 service()->CheckPermissionOnUIThread(profile(), | 351 service()->CheckPermissionOnUIThread(profile(), |
352 extension->url(), | 352 extension->url(), |
353 kFakeRenderProcessId)); | 353 kFakeRenderProcessId)); |
354 } | 354 } |
355 | 355 |
356 #endif // defined(ENABLE_EXTENSIONS) | 356 #endif // defined(ENABLE_EXTENSIONS) |
OLD | NEW |