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 "chrome/browser/extensions/api/push_messaging/push_messaging_api.h" | 5 #include "chrome/browser/extensions/api/push_messaging/push_messaging_api.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "chrome/browser/extensions/api/push_messaging/push_messaging_invalidati
on_handler.h" | 8 #include "chrome/browser/extensions/api/push_messaging/push_messaging_invalidati
on_handler.h" |
9 #include "chrome/browser/extensions/api/push_messaging/push_messaging_invalidati
on_mapper.h" | 9 #include "chrome/browser/extensions/api/push_messaging/push_messaging_invalidati
on_mapper.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 ExtensionApiTest::SetUpOnMainThread(); | 74 ExtensionApiTest::SetUpOnMainThread(); |
75 fake_invalidation_service_ = | 75 fake_invalidation_service_ = |
76 static_cast<invalidation::FakeInvalidationService*>( | 76 static_cast<invalidation::FakeInvalidationService*>( |
77 InvalidationServiceFactory::GetInstance()->GetForProfile( | 77 InvalidationServiceFactory::GetInstance()->GetForProfile( |
78 profile())); | 78 profile())); |
79 } | 79 } |
80 | 80 |
81 void EmitInvalidation( | 81 void EmitInvalidation( |
82 const invalidation::ObjectId& object_id, | 82 const invalidation::ObjectId& object_id, |
83 const std::string& payload) { | 83 const std::string& payload) { |
84 fake_invalidation_service_->EmitInvalidationForTest(object_id, payload); | 84 fake_invalidation_service_->EmitInvalidationForTest( |
| 85 object_id, |
| 86 syncer::Invalidation::kUnknownVersion, |
| 87 payload); |
85 } | 88 } |
86 | 89 |
87 PushMessagingAPI* GetAPI() { | 90 PushMessagingAPI* GetAPI() { |
88 return PushMessagingAPI::Get(profile()); | 91 return PushMessagingAPI::Get(profile()); |
89 } | 92 } |
90 | 93 |
91 PushMessagingEventRouter* GetEventRouter() { | 94 PushMessagingEventRouter* GetEventRouter() { |
92 return PushMessagingAPI::Get(profile())->GetEventRouterForTest(); | 95 return PushMessagingAPI::Get(profile())->GetEventRouterForTest(); |
93 } | 96 } |
94 | 97 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 const extensions::Extension* extension = | 188 const extensions::Extension* extension = |
186 LoadExtension(test_data_dir_.AppendASCII("push_messaging")); | 189 LoadExtension(test_data_dir_.AppendASCII("push_messaging")); |
187 ASSERT_TRUE(extension); | 190 ASSERT_TRUE(extension); |
188 ui_test_utils::NavigateToURL( | 191 ui_test_utils::NavigateToURL( |
189 browser(), extension->GetResourceURL("get_channel_id.html")); | 192 browser(), extension->GetResourceURL("get_channel_id.html")); |
190 | 193 |
191 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 194 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
192 } | 195 } |
193 | 196 |
194 } // namespace extensions | 197 } // namespace extensions |
OLD | NEW |