Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: chrome/browser/extensions/api/gcm/gcm_apitest.cc

Issue 589663004: Setting max TTL for upstream GCM messages to 1 day to match server side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing CL feedback Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/api/gcm.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(gcm::GCMClient::OutgoingMessage::kMaximumTTL, message.time_to_live);
fgorski 2014/09/22 21:12:50 Done. I was initially getting a linker error, but
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/api/gcm.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698