Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "blimp/engine/common/blimp_browser_context.h" | |
| 6 | |
| 7 #include "base/message_loop/message_loop.h" | |
| 8 #include "base/metrics/user_metrics.h" | |
| 9 #include "base/run_loop.h" | |
| 10 #include "components/metrics/metrics_service.h" | |
| 11 #include "content/public/test/test_browser_thread_bundle.h" | |
| 12 #include "net/log/net_log.h" | |
| 13 #include "testing/gtest/include/gtest/gtest.h" | |
| 14 | |
| 15 namespace blimp { | |
| 16 namespace engine { | |
| 17 | |
| 18 class BlimpBrowserContextTest : public testing::Test { | |
| 19 protected: | |
|
Alexei Svitkine (slow)
2016/05/10 17:38:07
Nit: Begin with a public section. Probably fine to
Jess
2016/05/10 18:23:49
Created a public section for the default construct
| |
| 20 void SetUp() override; | |
| 21 void TearDown() override; | |
| 22 private: | |
|
Alexei Svitkine (slow)
2016/05/10 17:38:07
Nit: Empty line above this.
Jess
2016/05/10 18:23:49
Done.
| |
| 23 content::TestBrowserThreadBundle thread_bundle_; | |
| 24 net::NetLog net_log_; | |
| 25 std::unique_ptr<BlimpBrowserContext> browser_context_; | |
| 26 }; | |
|
Alexei Svitkine (slow)
2016/05/10 17:38:07
Nit: DISALLOW_COPY_AND_ASSIGN().
Jess
2016/05/10 18:23:49
Done.
| |
| 27 | |
| 28 void BlimpBrowserContextTest::SetUp() { | |
|
Alexei Svitkine (slow)
2016/05/10 17:38:07
Nit: You can probably declare these inline.
Jess
2016/05/10 18:23:49
Done.
| |
| 29 base::SetRecordActionTaskRunner( | |
| 30 base::MessageLoop::current()->task_runner()); | |
| 31 // Create BlimpBrowserContext. | |
| 32 browser_context_.reset(new BlimpBrowserContext(false /* off_the_record */, | |
| 33 &net_log_)); | |
| 34 } | |
| 35 | |
| 36 void BlimpBrowserContextTest::TearDown() { | |
| 37 // Clears static variable in MetricsService | |
| 38 metrics::MetricsService::SetExecutionPhase( | |
| 39 metrics::MetricsService::UNINITIALIZED_PHASE, | |
| 40 browser_context_->GetPrefService()); | |
| 41 } | |
| 42 | |
| 43 TEST_F(BlimpBrowserContextTest, CtorDtor) { | |
| 44 // Covers construction and destruction of BlimpBrowserContext and | |
| 45 // associated metrics setup and teardown. | |
| 46 } | |
| 47 | |
| 48 } // namespace engine | |
| 49 } // namespace blimp | |
| OLD | NEW |