OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "chrome/browser/extensions/api/gcm/gcm_api.h" | 7 #include "chrome/browser/extensions/api/gcm/gcm_api.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_gcm_app_handler.h" | 9 #include "chrome/browser/extensions/extension_gcm_app_handler.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 | 164 |
165 IN_PROC_BROWSER_TEST_F(GcmApiTest, SendMessageDefaultTTL) { | 165 IN_PROC_BROWSER_TEST_F(GcmApiTest, SendMessageDefaultTTL) { |
166 StartCollecting(); | 166 StartCollecting(); |
167 ASSERT_TRUE(RunExtensionTest("gcm/functions/send_message_default_ttl")); | 167 ASSERT_TRUE(RunExtensionTest("gcm/functions/send_message_default_ttl")); |
168 | 168 |
169 EXPECT_EQ("destination-id", service()->last_receiver_id()); | 169 EXPECT_EQ("destination-id", service()->last_receiver_id()); |
170 const gcm::GCMClient::OutgoingMessage& message = | 170 const gcm::GCMClient::OutgoingMessage& message = |
171 service()->last_sent_message(); | 171 service()->last_sent_message(); |
172 gcm::GCMClient::MessageData::const_iterator iter; | 172 gcm::GCMClient::MessageData::const_iterator iter; |
173 | 173 |
174 EXPECT_EQ(2419200, message.time_to_live); | 174 EXPECT_EQ(24 * 60 * 60, message.time_to_live); |
jianli
2014/09/22 18:48:57
nit: can you refer to OutgoingMessage::kMaximumTTL
| |
175 } | 175 } |
176 | 176 |
177 IN_PROC_BROWSER_TEST_F(GcmApiTest, OnMessagesDeleted) { | 177 IN_PROC_BROWSER_TEST_F(GcmApiTest, OnMessagesDeleted) { |
178 ResultCatcher catcher; | 178 ResultCatcher catcher; |
179 catcher.RestrictToBrowserContext(profile()); | 179 catcher.RestrictToBrowserContext(profile()); |
180 | 180 |
181 const extensions::Extension* extension = | 181 const extensions::Extension* extension = |
182 LoadTestExtension(kEventsExtension, "on_messages_deleted.html"); | 182 LoadTestExtension(kEventsExtension, "on_messages_deleted.html"); |
183 ASSERT_TRUE(extension); | 183 ASSERT_TRUE(extension); |
184 | 184 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 incognito_catcher.RestrictToBrowserContext( | 256 incognito_catcher.RestrictToBrowserContext( |
257 profile()->GetOffTheRecordProfile()); | 257 profile()->GetOffTheRecordProfile()); |
258 | 258 |
259 ASSERT_TRUE(RunExtensionTestIncognito("gcm/functions/incognito")); | 259 ASSERT_TRUE(RunExtensionTestIncognito("gcm/functions/incognito")); |
260 | 260 |
261 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 261 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
262 EXPECT_TRUE(incognito_catcher.GetNextResult()) << incognito_catcher.message(); | 262 EXPECT_TRUE(incognito_catcher.GetNextResult()) << incognito_catcher.message(); |
263 } | 263 } |
264 | 264 |
265 } // namespace extensions | 265 } // namespace extensions |
OLD | NEW |