| OLD | NEW |
| 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/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // Base class for tests wanting to bring up a browser in the unit test process. | 45 // Base class for tests wanting to bring up a browser in the unit test process. |
| 46 // Writing tests with InProcessBrowserTest is slightly different than that of | 46 // Writing tests with InProcessBrowserTest is slightly different than that of |
| 47 // other tests. This is necessitated by InProcessBrowserTest running a message | 47 // other tests. This is necessitated by InProcessBrowserTest running a message |
| 48 // loop. To use InProcessBrowserTest do the following: | 48 // loop. To use InProcessBrowserTest do the following: |
| 49 // . Use the macro IN_PROC_BROWSER_TEST_F to define your test. | 49 // . Use the macro IN_PROC_BROWSER_TEST_F to define your test. |
| 50 // . Your test method is invoked on the ui thread. If you need to block until | 50 // . Your test method is invoked on the ui thread. If you need to block until |
| 51 // state changes you'll need to run the message loop from your test method. | 51 // state changes you'll need to run the message loop from your test method. |
| 52 // For example, if you need to wait till a find bar has completely been shown | 52 // For example, if you need to wait till a find bar has completely been shown |
| 53 // you'll need to invoke content::RunMessageLoop. When the message bar is | 53 // you'll need to invoke content::RunMessageLoop. When the message bar is |
| 54 // shown, invoke MessageLoop::current()->Quit() to return control back to your | 54 // shown, invoke MessageLoop::current()->QuitWhenIdle() to return control back |
| 55 // test method. | 55 // to your test method. |
| 56 // . If you subclass and override SetUp, be sure and invoke | 56 // . If you subclass and override SetUp, be sure and invoke |
| 57 // InProcessBrowserTest::SetUp. (But see also SetUpOnMainThread, | 57 // InProcessBrowserTest::SetUp. (But see also SetUpOnMainThread, |
| 58 // SetUpInProcessBrowserTestFixture and other related hook methods for a | 58 // SetUpInProcessBrowserTestFixture and other related hook methods for a |
| 59 // cleaner alternative). | 59 // cleaner alternative). |
| 60 // | 60 // |
| 61 // Following three hook methods are called in sequence before calling | 61 // Following three hook methods are called in sequence before calling |
| 62 // BrowserMain(), thus no browser has been created yet. They are mainly for | 62 // BrowserMain(), thus no browser has been created yet. They are mainly for |
| 63 // setting up the environment for running the browser. | 63 // setting up the environment for running the browser. |
| 64 // . SetUpUserDataDirectory() | 64 // . SetUpUserDataDirectory() |
| 65 // . SetUpCommandLine() | 65 // . SetUpCommandLine() |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; | 250 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; |
| 251 scoped_ptr<ScopedBundleSwizzlerMac> bundle_swizzler_; | 251 scoped_ptr<ScopedBundleSwizzlerMac> bundle_swizzler_; |
| 252 #endif // OS_MACOSX | 252 #endif // OS_MACOSX |
| 253 | 253 |
| 254 #if defined(OS_WIN) | 254 #if defined(OS_WIN) |
| 255 scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_; | 255 scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_; |
| 256 #endif | 256 #endif |
| 257 }; | 257 }; |
| 258 | 258 |
| 259 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 259 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ |
| OLD | NEW |