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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 results_.pop_front(); | 53 results_.pop_front(); |
54 return ret; | 54 return ret; |
55 } | 55 } |
56 NOTREACHED(); | 56 NOTREACHED(); |
57 return false; | 57 return false; |
58 } | 58 } |
59 | 59 |
60 private: | 60 private: |
61 virtual void Observe(int type, | 61 virtual void Observe(int type, |
62 const content::NotificationSource& source, | 62 const content::NotificationSource& source, |
63 const content::NotificationDetails& details) OVERRIDE { | 63 const content::NotificationDetails& details) override { |
64 results_.push_back( | 64 results_.push_back( |
65 static_cast<content::Source<extensions::TestSendMessageFunction> >( | 65 static_cast<content::Source<extensions::TestSendMessageFunction> >( |
66 source) | 66 source) |
67 .ptr() | 67 .ptr() |
68 ->user_gesture()); | 68 ->user_gesture()); |
69 if (waiting_) | 69 if (waiting_) |
70 base::MessageLoopForUI::current()->Quit(); | 70 base::MessageLoopForUI::current()->Quit(); |
71 } | 71 } |
72 | 72 |
73 content::NotificationRegistrar registrar_; | 73 content::NotificationRegistrar registrar_; |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 notification->ButtonClick(0); | 267 notification->ButtonClick(0); |
268 EXPECT_TRUE(catcher.GetNextResult()); | 268 EXPECT_TRUE(catcher.GetNextResult()); |
269 notification->Click(); | 269 notification->Click(); |
270 EXPECT_TRUE(catcher.GetNextResult()); | 270 EXPECT_TRUE(catcher.GetNextResult()); |
271 notification->Close(true); | 271 notification->Close(true); |
272 EXPECT_TRUE(catcher.GetNextResult()); | 272 EXPECT_TRUE(catcher.GetNextResult()); |
273 notification->Close(false); | 273 notification->Close(false); |
274 EXPECT_FALSE(catcher.GetNextResult()); | 274 EXPECT_FALSE(catcher.GetNextResult()); |
275 } | 275 } |
276 } | 276 } |
OLD | NEW |