Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: ui/views/test/platform_test_helper.cc

Issue 1984403002: Revert of Reland: mus: Add views_mus_interactive_ui_tests target (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/test/platform_test_helper.h ('k') | ui/views/test/scoped_views_test_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/views/test/platform_test_helper.h" 5 #include "ui/views/test/platform_test_helper.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 10
11 namespace views { 11 namespace views {
12 namespace { 12 namespace {
13 13
14 class DefaultPlatformTestHelper : public PlatformTestHelper { 14 class DefaultPlatformTestHelper : public PlatformTestHelper {
15 public: 15 public:
16 DefaultPlatformTestHelper() {} 16 DefaultPlatformTestHelper() {}
17 17
18 ~DefaultPlatformTestHelper() override {} 18 ~DefaultPlatformTestHelper() override {}
19 19
20 bool IsMus() const override { return false; }
21
20 private: 22 private:
21 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformTestHelper); 23 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformTestHelper);
22 }; 24 };
23 25
24 PlatformTestHelper::Factory test_helper_factory; 26 PlatformTestHelper::Factory test_helper_factory;
25 bool is_mus = false;
26 27
27 } // namespace 28 } // namespace
28 29
29 void PlatformTestHelper::set_factory(const Factory& factory) { 30 void PlatformTestHelper::set_factory(const Factory& factory) {
30 DCHECK(test_helper_factory.is_null()); 31 DCHECK(test_helper_factory.is_null());
31 test_helper_factory = factory; 32 test_helper_factory = factory;
32 } 33 }
33 34
34 // static 35 // static
35 std::unique_ptr<PlatformTestHelper> PlatformTestHelper::Create() { 36 std::unique_ptr<PlatformTestHelper> PlatformTestHelper::Create() {
36 return !test_helper_factory.is_null() 37 return !test_helper_factory.is_null()
37 ? test_helper_factory.Run() 38 ? test_helper_factory.Run()
38 : base::WrapUnique(new DefaultPlatformTestHelper); 39 : base::WrapUnique(new DefaultPlatformTestHelper);
39 } 40 }
40 41
41 // static
42 void PlatformTestHelper::SetIsMus() {
43 is_mus = true;
44 }
45
46 // static
47 bool PlatformTestHelper::IsMus() {
48 return is_mus;
49 }
50
51 } // namespace views 42 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/platform_test_helper.h ('k') | ui/views/test/scoped_views_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698