| 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 "apps/launcher.h" | 7 #include "apps/launcher.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #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_handler.h" |
| 10 #include "chrome/browser/extensions/api/push_messaging/push_messaging_invalidati
on_mapper.h" | 10 #include "chrome/browser/extensions/api/push_messaging/push_messaging_invalidati
on_mapper.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 MockInvalidationMapper::~MockInvalidationMapper() {} | 66 MockInvalidationMapper::~MockInvalidationMapper() {} |
| 67 | 67 |
| 68 } // namespace | 68 } // namespace |
| 69 | 69 |
| 70 class PushMessagingApiTest : public ExtensionApiTest { | 70 class PushMessagingApiTest : public ExtensionApiTest { |
| 71 public: | 71 public: |
| 72 PushMessagingApiTest() | 72 PushMessagingApiTest() |
| 73 : fake_invalidation_service_(NULL) { | 73 : fake_invalidation_service_(NULL) { |
| 74 } | 74 } |
| 75 | 75 |
| 76 virtual void SetUpCommandLine(CommandLine* command_line) override { | 76 void SetUpCommandLine(CommandLine* command_line) override { |
| 77 ExtensionApiTest::SetUpCommandLine(command_line); | 77 ExtensionApiTest::SetUpCommandLine(command_line); |
| 78 } | 78 } |
| 79 | 79 |
| 80 virtual void SetUp() override { | 80 virtual void SetUp() override { |
| 81 invalidation::ProfileInvalidationProviderFactory::GetInstance()-> | 81 invalidation::ProfileInvalidationProviderFactory::GetInstance()-> |
| 82 RegisterTestingFactory(BuildFakeProfileInvalidationProvider); | 82 RegisterTestingFactory(BuildFakeProfileInvalidationProvider); |
| 83 ExtensionApiTest::SetUp(); | 83 ExtensionApiTest::SetUp(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 virtual void SetUpOnMainThread() override { | 86 void SetUpOnMainThread() override { |
| 87 ExtensionApiTest::SetUpOnMainThread(); | 87 ExtensionApiTest::SetUpOnMainThread(); |
| 88 fake_invalidation_service_ = | 88 fake_invalidation_service_ = |
| 89 static_cast<invalidation::FakeInvalidationService*>( | 89 static_cast<invalidation::FakeInvalidationService*>( |
| 90 static_cast<invalidation::ProfileInvalidationProvider*>( | 90 static_cast<invalidation::ProfileInvalidationProvider*>( |
| 91 invalidation::ProfileInvalidationProviderFactory:: | 91 invalidation::ProfileInvalidationProviderFactory:: |
| 92 GetInstance()->GetForProfile(profile()))-> | 92 GetInstance()->GetForProfile(profile()))-> |
| 93 GetInvalidationService()); | 93 GetInvalidationService()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void EmitInvalidation( | 96 void EmitInvalidation( |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 const extensions::Extension* extension = | 201 const extensions::Extension* extension = |
| 202 LoadExtension(test_data_dir_.AppendASCII("push_messaging")); | 202 LoadExtension(test_data_dir_.AppendASCII("push_messaging")); |
| 203 ASSERT_TRUE(extension); | 203 ASSERT_TRUE(extension); |
| 204 ui_test_utils::NavigateToURL( | 204 ui_test_utils::NavigateToURL( |
| 205 browser(), extension->GetResourceURL("get_channel_id.html")); | 205 browser(), extension->GetResourceURL("get_channel_id.html")); |
| 206 | 206 |
| 207 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 207 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 } // namespace extensions | 210 } // namespace extensions |
| OLD | NEW |