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

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

Issue 10822030: Move ui_test_utils::RunMessageLoop to test_utils so that it can be reused by content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ 5 #ifndef CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_
6 #define CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ 6 #define CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 // Base class for tests wanting to bring up a browser in the unit test process. 43 // Base class for tests wanting to bring up a browser in the unit test process.
44 // Writing tests with InProcessBrowserTest is slightly different than that of 44 // Writing tests with InProcessBrowserTest is slightly different than that of
45 // other tests. This is necessitated by InProcessBrowserTest running a message 45 // other tests. This is necessitated by InProcessBrowserTest running a message
46 // loop. To use InProcessBrowserTest do the following: 46 // loop. To use InProcessBrowserTest do the following:
47 // . Use the macro IN_PROC_BROWSER_TEST_F to define your test. 47 // . Use the macro IN_PROC_BROWSER_TEST_F to define your test.
48 // . Your test method is invoked on the ui thread. If you need to block until 48 // . Your test method is invoked on the ui thread. If you need to block until
49 // state changes you'll need to run the message loop from your test method. 49 // state changes you'll need to run the message loop from your test method.
50 // For example, if you need to wait till a find bar has completely been shown 50 // For example, if you need to wait till a find bar has completely been shown
51 // you'll need to invoke ui_test_utils::RunMessageLoop. When the message bar 51 // you'll need to invoke content::RunMessageLoop. When the message bar is
52 // is shown, invoke MessageLoop::current()->Quit() to return control back to 52 // shown, invoke MessageLoop::current()->Quit() to return control back to your
53 // your test method. 53 // test method.
54 // . If you subclass and override SetUp, be sure and invoke 54 // . If you subclass and override SetUp, be sure and invoke
55 // InProcessBrowserTest::SetUp. (But see also SetUpOnMainThread, 55 // InProcessBrowserTest::SetUp. (But see also SetUpOnMainThread,
56 // SetUpInProcessBrowserTestFixture and other related hook methods for a 56 // SetUpInProcessBrowserTestFixture and other related hook methods for a
57 // cleaner alternative). 57 // cleaner alternative).
58 // 58 //
59 // Following three hook methods are called in sequence before calling 59 // Following three hook methods are called in sequence before calling
60 // BrowserMain(), thus no browser has been created yet. They are mainly for 60 // BrowserMain(), thus no browser has been created yet. They are mainly for
61 // setting up the environment for running the browser. 61 // setting up the environment for running the browser.
62 // . SetUpUserDataDirectory() 62 // . SetUpUserDataDirectory()
63 // . SetUpCommandLine() 63 // . SetUpCommandLine()
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 #if defined(OS_CHROMEOS) 207 #if defined(OS_CHROMEOS)
208 chromeos::ScopedStubCrosEnabler stub_cros_enabler_; 208 chromeos::ScopedStubCrosEnabler stub_cros_enabler_;
209 #endif // defined(OS_CHROMEOS) 209 #endif // defined(OS_CHROMEOS)
210 210
211 #if defined(OS_MACOSX) 211 #if defined(OS_MACOSX)
212 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; 212 base::mac::ScopedNSAutoreleasePool* autorelease_pool_;
213 #endif // OS_MACOSX 213 #endif // OS_MACOSX
214 }; 214 };
215 215
216 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ 216 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/web_ui_test_handler.cc ('k') | chrome/test/base/in_process_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698