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/base64.h" | 5 #include "base/base64.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 event->SetBoolean("lastMessage", last_message); | 61 event->SetBoolean("lastMessage", last_message); |
62 event->SetString("data", data); | 62 event->SetString("data", data); |
63 scoped_ptr<base::ListValue> arguments(new base::ListValue()); | 63 scoped_ptr<base::ListValue> arguments(new base::ListValue()); |
64 arguments->Append(event); | 64 arguments->Append(event); |
65 return arguments.Pass(); | 65 return arguments.Pass(); |
66 } | 66 } |
67 | 67 |
68 static scoped_ptr<Event> BuildEvent(scoped_ptr<base::ListValue> event_args, | 68 static scoped_ptr<Event> BuildEvent(scoped_ptr<base::ListValue> event_args, |
69 Profile* profile, | 69 Profile* profile, |
70 GURL event_url) { | 70 GURL event_url) { |
71 scoped_ptr<Event> event(new Event("test.onMessage", event_args.Pass())); | 71 scoped_ptr<Event> event( |
| 72 new Event(events::UNKNOWN, "test.onMessage", event_args.Pass())); |
72 event->restrict_to_browser_context = profile; | 73 event->restrict_to_browser_context = profile; |
73 event->event_url = event_url; | 74 event->event_url = event_url; |
74 return event.Pass(); | 75 return event.Pass(); |
75 } | 76 } |
76 | 77 |
77 void Observe(int type, | 78 void Observe(int type, |
78 const content::NotificationSource& source, | 79 const content::NotificationSource& source, |
79 const content::NotificationDetails& details) override { | 80 const content::NotificationDetails& details) override { |
80 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_FIRST_LOAD, | 81 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_FIRST_LOAD, |
81 type); | 82 type); |
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1194 ui_test_utils::NavigateToURL(browser(), chromium_org_url()); | 1195 ui_test_utils::NavigateToURL(browser(), chromium_org_url()); |
1195 EXPECT_EQ(COULD_NOT_ESTABLISH_CONNECTION_ERROR, | 1196 EXPECT_EQ(COULD_NOT_ESTABLISH_CONNECTION_ERROR, |
1196 CanConnectAndSendMessagesToMainFrame(invalid.get())); | 1197 CanConnectAndSendMessagesToMainFrame(invalid.get())); |
1197 } | 1198 } |
1198 | 1199 |
1199 #endif // !defined(OS_WIN) - http://crbug.com/350517. | 1200 #endif // !defined(OS_WIN) - http://crbug.com/350517. |
1200 | 1201 |
1201 } // namespace | 1202 } // namespace |
1202 | 1203 |
1203 }; // namespace extensions | 1204 }; // namespace extensions |
OLD | NEW |