| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 event->SetString("data", data); | 79 event->SetString("data", data); |
| 80 std::unique_ptr<base::ListValue> arguments(new base::ListValue()); | 80 std::unique_ptr<base::ListValue> arguments(new base::ListValue()); |
| 81 arguments->Append(std::move(event)); | 81 arguments->Append(std::move(event)); |
| 82 return arguments; | 82 return arguments; |
| 83 } | 83 } |
| 84 | 84 |
| 85 static std::unique_ptr<Event> BuildEvent( | 85 static std::unique_ptr<Event> BuildEvent( |
| 86 std::unique_ptr<base::ListValue> event_args, | 86 std::unique_ptr<base::ListValue> event_args, |
| 87 Profile* profile, | 87 Profile* profile, |
| 88 GURL event_url) { | 88 GURL event_url) { |
| 89 std::unique_ptr<Event> event(new Event( | 89 auto event = |
| 90 events::TEST_ON_MESSAGE, "test.onMessage", std::move(event_args))); | 90 base::MakeUnique<Event>(events::TEST_ON_MESSAGE, "test.onMessage", |
| 91 event->restrict_to_browser_context = profile; | 91 std::move(event_args), profile); |
| 92 event->event_url = event_url; | 92 event->event_url = event_url; |
| 93 return event; | 93 return event; |
| 94 } | 94 } |
| 95 | 95 |
| 96 void Observe(int type, | 96 void Observe(int type, |
| 97 const content::NotificationSource& source, | 97 const content::NotificationSource& source, |
| 98 const content::NotificationDetails& details) override { | 98 const content::NotificationDetails& details) override { |
| 99 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_FIRST_LOAD, | 99 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_FIRST_LOAD, |
| 100 type); | 100 type); |
| 101 EventRouter* event_router = | 101 EventRouter* event_router = |
| (...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( | 1322 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( |
| 1323 background_contents, | 1323 background_contents, |
| 1324 "window.domAutomationController.send(window.messageCount);", | 1324 "window.domAutomationController.send(window.messageCount);", |
| 1325 &message_count)); | 1325 &message_count)); |
| 1326 EXPECT_EQ(1, message_count); | 1326 EXPECT_EQ(1, message_count); |
| 1327 } | 1327 } |
| 1328 | 1328 |
| 1329 } // namespace | 1329 } // namespace |
| 1330 | 1330 |
| 1331 }; // namespace extensions | 1331 }; // namespace extensions |
| OLD | NEW |