| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/public/browser/push_messaging_service.h" | 5 #include "content/public/browser/push_messaging_service.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
| 15 #include "base/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
| 16 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 16 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 17 #include "chrome/browser/permissions/permission_manager.h" | 17 #include "chrome/browser/permissions/permission_manager.h" |
| 18 #include "chrome/browser/permissions/permission_manager_factory.h" | 18 #include "chrome/browser/permissions/permission_manager_factory.h" |
| 19 #include "chrome/browser/push_messaging/push_messaging_app_identifier.h" | 19 #include "chrome/browser/push_messaging/push_messaging_app_identifier.h" |
| 20 #include "chrome/browser/push_messaging/push_messaging_permission_context.h" | 20 #include "chrome/browser/push_messaging/push_messaging_permission_context.h" |
| 21 #include "chrome/browser/push_messaging/push_messaging_service_factory.h" | 21 #include "chrome/browser/push_messaging/push_messaging_service_factory.h" |
| 22 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" | 22 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" |
| 23 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" | 23 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" |
| 24 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | 24 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
| 25 #include "chrome/test/base/testing_profile.h" | 25 #include "chrome/test/base/testing_profile.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 EXPECT_EQ(kTestEncodedP256Key, push_service->NormalizeSenderInfo(p256dh)); | 236 EXPECT_EQ(kTestEncodedP256Key, push_service->NormalizeSenderInfo(p256dh)); |
| 237 | 237 |
| 238 // Any other value, binary or not, will be passed through as-is. | 238 // Any other value, binary or not, will be passed through as-is. |
| 239 EXPECT_EQ("1234567890", push_service->NormalizeSenderInfo("1234567890")); | 239 EXPECT_EQ("1234567890", push_service->NormalizeSenderInfo("1234567890")); |
| 240 EXPECT_EQ("foo@bar.com", push_service->NormalizeSenderInfo("foo@bar.com")); | 240 EXPECT_EQ("foo@bar.com", push_service->NormalizeSenderInfo("foo@bar.com")); |
| 241 | 241 |
| 242 p256dh[0] = 0x05; // invalidate |p256dh| as a public key. | 242 p256dh[0] = 0x05; // invalidate |p256dh| as a public key. |
| 243 | 243 |
| 244 EXPECT_EQ(p256dh, push_service->NormalizeSenderInfo(p256dh)); | 244 EXPECT_EQ(p256dh, push_service->NormalizeSenderInfo(p256dh)); |
| 245 } | 245 } |
| OLD | NEW |