Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: chrome/test/base/in_process_browser_test.cc

Issue 9160020: Wires up disabling visibility animations for aura, and explicitly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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 | Annotate | Revision Log
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 "chrome/test/base/in_process_browser_test.h" 5 #include "chrome/test/base/in_process_browser_test.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 28 matching lines...) Expand all
39 #include "net/test/test_server.h" 39 #include "net/test/test_server.h"
40 40
41 #if defined(OS_CHROMEOS) 41 #if defined(OS_CHROMEOS)
42 #include "chrome/browser/chromeos/audio/audio_handler.h" 42 #include "chrome/browser/chromeos/audio/audio_handler.h"
43 #elif defined(OS_MACOSX) 43 #elif defined(OS_MACOSX)
44 #include "base/mac/scoped_nsautorelease_pool.h" 44 #include "base/mac/scoped_nsautorelease_pool.h"
45 #endif 45 #endif
46 46
47 #if defined(USE_AURA) 47 #if defined(USE_AURA)
48 #include "ui/aura/root_window.h" 48 #include "ui/aura/root_window.h"
49 #include "ui/views/widget/widget.h"
49 #endif 50 #endif
50 51
51 namespace { 52 namespace {
52 53
53 // Passed as value of kTestType. 54 // Passed as value of kTestType.
54 const char kBrowserTestType[] = "browser"; 55 const char kBrowserTestType[] = "browser";
55 56
56 } // namespace 57 } // namespace
57 58
58 InProcessBrowserTest::InProcessBrowserTest() 59 InProcessBrowserTest::InProcessBrowserTest()
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 245 }
245 246
246 void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { 247 void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) {
247 ui_test_utils::WindowedNotificationObserver observer( 248 ui_test_utils::WindowedNotificationObserver observer(
248 content::NOTIFICATION_LOAD_STOP, 249 content::NOTIFICATION_LOAD_STOP,
249 content::NotificationService::AllSources()); 250 content::NotificationService::AllSources());
250 browser->AddSelectedTabWithURL( 251 browser->AddSelectedTabWithURL(
251 GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_START_PAGE); 252 GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_START_PAGE);
252 observer.Wait(); 253 observer.Wait();
253 254
255 #if defined(USE_AURA)
256 // Disable animations on aura, otherwise any code that gets the bounds may get
Ben Goodger (Google) 2012/01/24 04:39:13 // TODO(beng): USE_ASH
257 // the wrong thing.
258 views::Widget* widget = views::Widget::GetWidgetForNativeView(
Paweł Hajdan Jr. 2012/01/24 19:02:51 This is perfectly fine. One thing: do we run UI te
259 browser->window()->GetNativeHandle());
260 widget->SetVisibilityChangedAnimationsEnabled(false);
Ben Goodger (Google) 2012/01/24 04:39:13 1. looks like you're missing changes to Widget in
261 #endif
262
254 browser->window()->Show(); 263 browser->window()->Show();
255 } 264 }
256 265
257 #if defined(OS_POSIX) 266 #if defined(OS_POSIX)
258 // On SIGTERM (sent by the runner on timeouts), dump a stack trace (to make 267 // On SIGTERM (sent by the runner on timeouts), dump a stack trace (to make
259 // debugging easier) and also exit with a known error code (so that the test 268 // debugging easier) and also exit with a known error code (so that the test
260 // framework considers this a failure -- http://crbug.com/57578). 269 // framework considers this a failure -- http://crbug.com/57578).
261 static void DumpStackTraceSignalHandler(int signal) { 270 static void DumpStackTraceSignalHandler(int signal) {
262 base::debug::StackTrace().PrintBacktrace(); 271 base::debug::StackTrace().PrintBacktrace();
263 _exit(128 + signal); 272 _exit(128 + signal);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 if (BrowserList::size() == 0) 333 if (BrowserList::size() == 0)
325 return; 334 return;
326 335
327 // Invoke CloseAllBrowsersAndMayExit on a running message loop. 336 // Invoke CloseAllBrowsersAndMayExit on a running message loop.
328 // CloseAllBrowsersAndMayExit exits the message loop after everything has been 337 // CloseAllBrowsersAndMayExit exits the message loop after everything has been
329 // shut down properly. 338 // shut down properly.
330 MessageLoopForUI::current()->PostTask(FROM_HERE, 339 MessageLoopForUI::current()->PostTask(FROM_HERE,
331 base::Bind(&BrowserList::AttemptExit)); 340 base::Bind(&BrowserList::AttemptExit));
332 ui_test_utils::RunMessageLoop(); 341 ui_test_utils::RunMessageLoop();
333 } 342 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698