| 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/run_loop.h" | 5 #include "base/run_loop.h" |
| 6 #include "chrome/browser/extensions/api/gcm/gcm_api.h" | 6 #include "chrome/browser/extensions/api/gcm/gcm_api.h" |
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" | 9 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" |
| 10 #include "chrome/browser/services/gcm/gcm_client_factory.h" | 10 #include "chrome/browser/services/gcm/gcm_client_factory.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 EXPECT_EQ("26469186F238EE08FA71C38311C6990F61D40DCA", | 94 EXPECT_EQ("26469186F238EE08FA71C38311C6990F61D40DCA", |
| 95 service()->last_registered_cert()); | 95 service()->last_registered_cert()); |
| 96 const std::vector<std::string>& sender_ids = | 96 const std::vector<std::string>& sender_ids = |
| 97 service()->last_registered_sender_ids(); | 97 service()->last_registered_sender_ids(); |
| 98 EXPECT_TRUE(std::find(sender_ids.begin(), sender_ids.end(), "Sender1") != | 98 EXPECT_TRUE(std::find(sender_ids.begin(), sender_ids.end(), "Sender1") != |
| 99 sender_ids.end()); | 99 sender_ids.end()); |
| 100 EXPECT_TRUE(std::find(sender_ids.begin(), sender_ids.end(), "Sender2") != | 100 EXPECT_TRUE(std::find(sender_ids.begin(), sender_ids.end(), "Sender2") != |
| 101 sender_ids.end()); | 101 sender_ids.end()); |
| 102 } | 102 } |
| 103 | 103 |
| 104 IN_PROC_BROWSER_TEST_F(GcmApiTest, RegisterWithoutKey) { |
| 105 if (ShouldSkipTest()) |
| 106 return; |
| 107 |
| 108 ASSERT_TRUE(RunExtensionTest("gcm/functions/register_without_key")); |
| 109 } |
| 110 |
| 104 IN_PROC_BROWSER_TEST_F(GcmApiTest, SendValidation) { | 111 IN_PROC_BROWSER_TEST_F(GcmApiTest, SendValidation) { |
| 105 if (ShouldSkipTest()) | 112 if (ShouldSkipTest()) |
| 106 return; | 113 return; |
| 107 | 114 |
| 108 ASSERT_TRUE(RunExtensionTest("gcm/functions/send")); | 115 ASSERT_TRUE(RunExtensionTest("gcm/functions/send")); |
| 109 } | 116 } |
| 110 | 117 |
| 111 IN_PROC_BROWSER_TEST_F(GcmApiTest, SendMessageData) { | 118 IN_PROC_BROWSER_TEST_F(GcmApiTest, SendMessageData) { |
| 112 if (ShouldSkipTest()) | 119 if (ShouldSkipTest()) |
| 113 return; | 120 return; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 ResultCatcher incognito_catcher; | 197 ResultCatcher incognito_catcher; |
| 191 incognito_catcher.RestrictToProfile(profile()->GetOffTheRecordProfile()); | 198 incognito_catcher.RestrictToProfile(profile()->GetOffTheRecordProfile()); |
| 192 | 199 |
| 193 ASSERT_TRUE(RunExtensionTestIncognito("gcm/functions/incognito")); | 200 ASSERT_TRUE(RunExtensionTestIncognito("gcm/functions/incognito")); |
| 194 | 201 |
| 195 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 202 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 196 EXPECT_TRUE(incognito_catcher.GetNextResult()) << incognito_catcher.message(); | 203 EXPECT_TRUE(incognito_catcher.GetNextResult()) << incognito_catcher.message(); |
| 197 } | 204 } |
| 198 | 205 |
| 199 } // namespace extensions | 206 } // namespace extensions |
| OLD | NEW |