| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 "ash/test/ash_test_environment.h" | 5 #include "ash/test/ash_test_environment.h" |
| 6 | 6 |
| 7 #include "ash/test/ash_test_views_delegate.h" | 7 #include "ash/test/ash_test_views_delegate.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // AshTestEnvironment: | 28 // AshTestEnvironment: |
| 29 base::SequencedWorkerPool* GetBlockingPool() override { | 29 base::SequencedWorkerPool* GetBlockingPool() override { |
| 30 if (!blocking_pool_owner_) { | 30 if (!blocking_pool_owner_) { |
| 31 const size_t kMaxNumberThreads = 3u; // Matches that of content. | 31 const size_t kMaxNumberThreads = 3u; // Matches that of content. |
| 32 const char kThreadNamePrefix[] = "AshBlocking"; | 32 const char kThreadNamePrefix[] = "AshBlocking"; |
| 33 blocking_pool_owner_ = base::MakeUnique<base::SequencedWorkerPoolOwner>( | 33 blocking_pool_owner_ = base::MakeUnique<base::SequencedWorkerPoolOwner>( |
| 34 kMaxNumberThreads, kThreadNamePrefix); | 34 kMaxNumberThreads, kThreadNamePrefix); |
| 35 } | 35 } |
| 36 return blocking_pool_owner_->pool().get(); | 36 return blocking_pool_owner_->pool().get(); |
| 37 } | 37 } |
| 38 std::unique_ptr<views::ViewsDelegate> CreateViewsDelegate() override { | 38 std::unique_ptr<AshTestViewsDelegate> CreateViewsDelegate() override { |
| 39 return base::MakeUnique<AshTestViewsDelegate>(); | 39 return base::MakeUnique<AshTestViewsDelegate>(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 base::MessageLoopForUI message_loop_; | 43 base::MessageLoopForUI message_loop_; |
| 44 std::unique_ptr<base::SequencedWorkerPoolOwner> blocking_pool_owner_; | 44 std::unique_ptr<base::SequencedWorkerPoolOwner> blocking_pool_owner_; |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(AshTestEnvironmentDefault); | 46 DISALLOW_COPY_AND_ASSIGN(AshTestEnvironmentDefault); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace | 49 } // namespace |
| 50 | 50 |
| 51 // static | 51 // static |
| 52 std::unique_ptr<AshTestEnvironment> AshTestEnvironment::Create() { | 52 std::unique_ptr<AshTestEnvironment> AshTestEnvironment::Create() { |
| 53 return base::MakeUnique<AshTestEnvironmentDefault>(); | 53 return base::MakeUnique<AshTestEnvironmentDefault>(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 // static | 56 // static |
| 57 std::string AshTestEnvironment::Get100PercentResourceFileName() { | 57 std::string AshTestEnvironment::Get100PercentResourceFileName() { |
| 58 return "ash_test_resources_100_percent.pak"; | 58 return "ash_test_resources_100_percent.pak"; |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace test | 61 } // namespace test |
| 62 } // namespace ash | 62 } // namespace ash |
| OLD | NEW |