| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <map> | 5 #include <map> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 return g_browser_process->message_center(); | 66 return g_browser_process->message_center(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 Profile* profile() { return browser()->profile(); } | 69 Profile* profile() { return browser()->profile(); } |
| 70 | 70 |
| 71 class TestDelegate : public NotificationDelegate { | 71 class TestDelegate : public NotificationDelegate { |
| 72 public: | 72 public: |
| 73 explicit TestDelegate(const std::string& id) : id_(id) {} | 73 explicit TestDelegate(const std::string& id) : id_(id) {} |
| 74 | 74 |
| 75 void Display() override { log_ += "Display_"; } | 75 void Display() override { log_ += "Display_"; } |
| 76 void Error() override { log_ += "Error_"; } | |
| 77 void Close(bool by_user) override { | 76 void Close(bool by_user) override { |
| 78 log_ += "Close_"; | 77 log_ += "Close_"; |
| 79 log_ += ( by_user ? "by_user_" : "programmatically_"); | 78 log_ += ( by_user ? "by_user_" : "programmatically_"); |
| 80 } | 79 } |
| 81 void Click() override { log_ += "Click_"; } | 80 void Click() override { log_ += "Click_"; } |
| 82 void ButtonClick(int button_index) override { | 81 void ButtonClick(int button_index) override { |
| 83 log_ += "ButtonClick_"; | 82 log_ += "ButtonClick_"; |
| 84 log_ += base::IntToString(button_index) + "_"; | 83 log_ += base::IntToString(button_index) + "_"; |
| 85 } | 84 } |
| 86 std::string id() const override { return id_; } | 85 std::string id() const override { return id_; } |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 manager()->Update(notification, profile()); | 350 manager()->Update(notification, profile()); |
| 352 | 351 |
| 353 // Expect that the progress notification update is performed. | 352 // Expect that the progress notification update is performed. |
| 354 EXPECT_EQ(base::StringPrintf("update-%s", notification_id.c_str()), | 353 EXPECT_EQ(base::StringPrintf("update-%s", notification_id.c_str()), |
| 355 observer.log(notification_id)); | 354 observer.log(notification_id)); |
| 356 | 355 |
| 357 delegate->Release(); | 356 delegate->Release(); |
| 358 } | 357 } |
| 359 | 358 |
| 360 #endif // !defined(OS_MACOSX) | 359 #endif // !defined(OS_MACOSX) |
| OLD | NEW |