| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/string_number_conversions.h" | 5 #include "base/strings/string_number_conversions.h" |
| 6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/extensions/api/notifications/notifications_api.h" | 9 #include "chrome/browser/extensions/api/notifications/notifications_api.h" |
| 10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, | 90 extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, |
| 91 content::NotificationService::AllSources()); | 91 content::NotificationService::AllSources()); |
| 92 const extensions::Extension* extension = LoadExtension(extdir); | 92 const extensions::Extension* extension = LoadExtension(extdir); |
| 93 if (extension) { | 93 if (extension) { |
| 94 page_created.Wait(); | 94 page_created.Wait(); |
| 95 } | 95 } |
| 96 return extension; | 96 return extension; |
| 97 } | 97 } |
| 98 | 98 |
| 99 protected: | 99 protected: |
| 100 std::string GetNotificationIdFromDelegateId(std::string delegate_id) { | 100 std::string GetNotificationIdFromDelegateId(const std::string& delegate_id) { |
| 101 return g_browser_process->notification_ui_manager() | 101 return g_browser_process->notification_ui_manager() |
| 102 ->FindById( | 102 ->FindById( |
| 103 delegate_id, | 103 delegate_id, |
| 104 NotificationUIManager::GetProfileID( | 104 NotificationUIManager::GetProfileID( |
| 105 g_browser_process->profile_manager()->GetLastUsedProfile())) | 105 g_browser_process->profile_manager()->GetLastUsedProfile())) |
| 106 ->id(); | 106 ->id(); |
| 107 } | 107 } |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace | 110 } // namespace |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 notification->ButtonClick(0); | 282 notification->ButtonClick(0); |
| 283 EXPECT_TRUE(catcher.GetNextResult()); | 283 EXPECT_TRUE(catcher.GetNextResult()); |
| 284 notification->Click(); | 284 notification->Click(); |
| 285 EXPECT_TRUE(catcher.GetNextResult()); | 285 EXPECT_TRUE(catcher.GetNextResult()); |
| 286 notification->Close(true); | 286 notification->Close(true); |
| 287 EXPECT_TRUE(catcher.GetNextResult()); | 287 EXPECT_TRUE(catcher.GetNextResult()); |
| 288 notification->Close(false); | 288 notification->Close(false); |
| 289 EXPECT_FALSE(catcher.GetNextResult()); | 289 EXPECT_FALSE(catcher.GetNextResult()); |
| 290 } | 290 } |
| 291 } | 291 } |
| OLD | NEW |