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

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

Issue 1982963002: Reland: mus: Add views_mus_interactive_ui_tests target (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix size_t to int warning on Windows 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
22 private: 20 private:
23 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformTestHelper); 21 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformTestHelper);
24 }; 22 };
25 23
26 PlatformTestHelper::Factory test_helper_factory; 24 PlatformTestHelper::Factory test_helper_factory;
25 bool is_mus = false;
27 26
28 } // namespace 27 } // namespace
29 28
30 void PlatformTestHelper::set_factory(const Factory& factory) { 29 void PlatformTestHelper::set_factory(const Factory& factory) {
31 DCHECK(test_helper_factory.is_null()); 30 DCHECK(test_helper_factory.is_null());
32 test_helper_factory = factory; 31 test_helper_factory = factory;
33 } 32 }
34 33
35 // static 34 // static
36 std::unique_ptr<PlatformTestHelper> PlatformTestHelper::Create() { 35 std::unique_ptr<PlatformTestHelper> PlatformTestHelper::Create() {
37 return !test_helper_factory.is_null() 36 return !test_helper_factory.is_null()
38 ? test_helper_factory.Run() 37 ? test_helper_factory.Run()
39 : base::WrapUnique(new DefaultPlatformTestHelper); 38 : base::WrapUnique(new DefaultPlatformTestHelper);
40 } 39 }
41 40
41 // static
42 void PlatformTestHelper::SetIsMus() {
43 is_mus = true;
44 }
45
46 // static
47 bool PlatformTestHelper::IsMus() {
48 return is_mus;
49 }
50
42 } // namespace views 51 } // 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