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

Side by Side Diff: content/public/test/browser_test_base.cc

Issue 1845343005: Makes MaterialDesignController initialization explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed methods in Linux bits Created 4 years, 8 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/public/test/browser_test_base.h" 5 #include "content/public/test/browser_test_base.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 12 matching lines...) Expand all
23 #include "content/public/browser/browser_thread.h" 23 #include "content/public/browser/browser_thread.h"
24 #include "content/public/common/content_switches.h" 24 #include "content/public/common/content_switches.h"
25 #include "content/public/common/main_function_params.h" 25 #include "content/public/common/main_function_params.h"
26 #include "content/public/test/test_launcher.h" 26 #include "content/public/test/test_launcher.h"
27 #include "content/public/test/test_utils.h" 27 #include "content/public/test/test_utils.h"
28 #include "content/test/content_browser_sanity_checker.h" 28 #include "content/test/content_browser_sanity_checker.h"
29 #include "net/base/net_errors.h" 29 #include "net/base/net_errors.h"
30 #include "net/base/network_interfaces.h" 30 #include "net/base/network_interfaces.h"
31 #include "net/dns/mock_host_resolver.h" 31 #include "net/dns/mock_host_resolver.h"
32 #include "net/test/embedded_test_server/embedded_test_server.h" 32 #include "net/test/embedded_test_server/embedded_test_server.h"
33 #include "ui/base/test/material_design_controller_test_api.h"
33 #include "ui/compositor/compositor_switches.h" 34 #include "ui/compositor/compositor_switches.h"
34 #include "ui/gl/gl_implementation.h" 35 #include "ui/gl/gl_implementation.h"
35 #include "ui/gl/gl_switches.h" 36 #include "ui/gl/gl_switches.h"
36 37
37 #if defined(OS_POSIX) 38 #if defined(OS_POSIX)
38 #include "base/process/process_handle.h" 39 #include "base/process/process_handle.h"
39 #endif 40 #endif
40 41
41 #if defined(OS_MACOSX) 42 #if defined(OS_MACOSX)
42 #include "base/mac/foundation_util.h" 43 #include "base/mac/foundation_util.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 #endif 173 #endif
173 174
174 CHECK(set_up_called_) << "SetUp was not called. This probably means that the " 175 CHECK(set_up_called_) << "SetUp was not called. This probably means that the "
175 "developer has overridden the method and not called " 176 "developer has overridden the method and not called "
176 "the superclass version. In this case, the test " 177 "the superclass version. In this case, the test "
177 "does not run and reports a false positive result."; 178 "does not run and reports a false positive result.";
178 } 179 }
179 180
180 void BrowserTestBase::SetUp() { 181 void BrowserTestBase::SetUp() {
181 set_up_called_ = true; 182 set_up_called_ = true;
183 // ContentTestSuiteBase might have already initialized
184 // MaterialDesignController in browser_tests suite.
185 // Uninitialize here to let the browser process do it.
186 ui::test::MaterialDesignControllerTestAPI::UninitializeMode();
sky 2016/04/11 15:32:40 Is it possible to supply a flag to ContentTestSuit
varkha 2016/04/11 19:30:58 Not sure how this would be possible. The call stac
182 187
183 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 188 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
184 189
185 // Override the child process connection timeout since tests can exceed that 190 // Override the child process connection timeout since tests can exceed that
186 // when sharded. 191 // when sharded.
187 command_line->AppendSwitchASCII( 192 command_line->AppendSwitchASCII(
188 switches::kIPCConnectionTimeout, 193 switches::kIPCConnectionTimeout,
189 base::Int64ToString(TestTimeouts::action_max_timeout().InSeconds())); 194 base::Int64ToString(TestTimeouts::action_max_timeout().InSeconds()));
190 195
191 // The tests assume that file:// URIs can freely access other file:// URIs. 196 // The tests assume that file:// URIs can freely access other file:// URIs.
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 use_software_compositing_ = true; 366 use_software_compositing_ = true;
362 } 367 }
363 368
364 bool BrowserTestBase::UsingOSMesa() const { 369 bool BrowserTestBase::UsingOSMesa() const {
365 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); 370 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
366 return cmd->GetSwitchValueASCII(switches::kUseGL) == 371 return cmd->GetSwitchValueASCII(switches::kUseGL) ==
367 gfx::kGLImplementationOSMesaName; 372 gfx::kGLImplementationOSMesaName;
368 } 373 }
369 374
370 } // namespace content 375 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698