Chromium Code Reviews| Index: blimp/engine/app/blimp_system_url_request_context_getter_unittest.cc |
| diff --git a/blimp/engine/app/blimp_system_url_request_context_getter_unittest.cc b/blimp/engine/app/blimp_system_url_request_context_getter_unittest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5a4950230fae0e45721eea4d8ecd7610b7e3898a |
| --- /dev/null |
| +++ b/blimp/engine/app/blimp_system_url_request_context_getter_unittest.cc |
| @@ -0,0 +1,42 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "blimp/engine/app/blimp_system_url_request_context_getter.h" |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/message_loop/message_loop.h" |
| +#include "content/public/test/test_browser_thread.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace blimp { |
| +namespace engine { |
| + |
| +namespace { |
| +class BlimpSystemURLRequestContextGetterTest : public testing::Test { |
| + public: |
| + BlimpSystemURLRequestContextGetterTest() |
| + : ui_thread_(content::BrowserThread::UI, &message_loop_), |
| + io_thread_(content::BrowserThread::IO, &message_loop_), |
| + system_url_request_context_getter_( |
| + new BlimpSystemURLRequestContextGetter()) {} |
| + |
| + void TearDown() override { message_loop_.RunUntilIdle(); } |
| + protected: |
| + base::MessageLoopForUI message_loop_; |
| + content::TestBrowserThread ui_thread_; |
|
haibinlu
2016/05/07 01:53:34
content::TestBrowserThread is deprecated?
Jess
2016/05/09 17:31:42
Thanks for catching that. TestBrowserThreadBundle
|
| + content::TestBrowserThread io_thread_; |
| + scoped_refptr<BlimpSystemURLRequestContextGetter> |
| + system_url_request_context_getter_; |
| +}; |
| + |
| +TEST_F(BlimpSystemURLRequestContextGetterTest, GetURLRequestContext) { |
| + ASSERT_NE(nullptr, |
| + system_url_request_context_getter_->GetURLRequestContext()); |
| +} |
| + |
| +} // namespace |
| + |
| +} // engine |
| +} // blimp |