| 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 "chrome/browser/extensions/api/gcd_private/privet_v3_context_getter.h" | 5 #include "chrome/browser/extensions/api/gcd_private/privet_v3_context_getter.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 using net::EmbeddedTestServer; | 26 using net::EmbeddedTestServer; |
| 27 | 27 |
| 28 class PrivetV3ContextGetterTest : public testing::Test, | 28 class PrivetV3ContextGetterTest : public testing::Test, |
| 29 public net::URLFetcherDelegate { | 29 public net::URLFetcherDelegate { |
| 30 protected: | 30 protected: |
| 31 PrivetV3ContextGetterTest() | 31 PrivetV3ContextGetterTest() |
| 32 : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD) {} | 32 : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD) {} |
| 33 | 33 |
| 34 void SetUp() override { | 34 void SetUp() override { |
| 35 context_getter_ = new extensions::PrivetV3ContextGetter( | 35 context_getter_ = new extensions::PrivetV3ContextGetter( |
| 36 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 36 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void OnURLFetchComplete(const net::URLFetcher* source) override { | 39 void OnURLFetchComplete(const net::URLFetcher* source) override { |
| 40 done_ = true; | 40 done_ = true; |
| 41 status_ = source->GetStatus(); | 41 status_ = source->GetStatus(); |
| 42 | 42 |
| 43 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, quit_); | 43 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, quit_); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void CreateServer(EmbeddedTestServer::Type type) { | 46 void CreateServer(EmbeddedTestServer::Type type) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 CreateServer(EmbeddedTestServer::TYPE_HTTPS); | 125 CreateServer(EmbeddedTestServer::TYPE_HTTPS); |
| 126 SetFingerprint(GetServerFingerprint()); | 126 SetFingerprint(GetServerFingerprint()); |
| 127 EXPECT_EQ(net::URLRequestStatus::SUCCESS, Run()); | 127 EXPECT_EQ(net::URLRequestStatus::SUCCESS, Run()); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namespace | 131 } // namespace |
| 132 | 132 |
| 133 } // namespace extensions | 133 } // namespace extensions |
| OLD | NEW |