| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/extensions/app_notify_channel_setup.h" | 10 #include "chrome/browser/extensions/app_notify_channel_setup.h" |
| 11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
| 12 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
| 13 #include "chrome/test/base/testing_pref_service.h" | 13 #include "chrome/test/base/testing_pref_service.h" |
| 14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 15 #include "content/test/test_browser_thread.h" | 15 #include "content/test/test_browser_thread.h" |
| 16 #include "content/test/test_url_fetcher_factory.h" | 16 #include "content/test/test_url_fetcher_factory.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 using content::BrowserThread; |
| 21 |
| 20 namespace { | 22 namespace { |
| 21 | 23 |
| 22 const int kRouteId = 4; | 24 const int kRouteId = 4; |
| 23 const int kCallbackId = 5; | 25 const int kCallbackId = 5; |
| 24 | 26 |
| 25 class TestDelegate : public AppNotifyChannelSetup::Delegate, | 27 class TestDelegate : public AppNotifyChannelSetup::Delegate, |
| 26 public base::SupportsWeakPtr<TestDelegate> { | 28 public base::SupportsWeakPtr<TestDelegate> { |
| 27 public: | 29 public: |
| 28 TestDelegate() : was_called_(false) {} | 30 TestDelegate() : was_called_(false) {} |
| 29 virtual ~TestDelegate() {} | 31 virtual ~TestDelegate() {} |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 std::string(), std::string("not_available")); | 181 std::string(), std::string("not_available")); |
| 180 } | 182 } |
| 181 | 183 |
| 182 TEST_F(AppNotifyChannelSetupTest, ServerSuccess) { | 184 TEST_F(AppNotifyChannelSetupTest, ServerSuccess) { |
| 183 RunServerTest(true, "dummy_do_not_use", ""); | 185 RunServerTest(true, "dummy_do_not_use", ""); |
| 184 } | 186 } |
| 185 | 187 |
| 186 TEST_F(AppNotifyChannelSetupTest, ServerFailure) { | 188 TEST_F(AppNotifyChannelSetupTest, ServerFailure) { |
| 187 RunServerTest(false, "", "channel_service_error"); | 189 RunServerTest(false, "", "channel_service_error"); |
| 188 } | 190 } |
| OLD | NEW |