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

Unified Diff: content/public/test/browser_test_base.cc

Issue 468493003: Admixtures in BrowserTestBase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed teardown fixes Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/browser_test_base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_base.cc
diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc
index 34932427aa6b832a7b00595fadf4f11e9c2509eb..925bf58b795ee9ddae955ddad119b955ba7063e4 100644
--- a/content/public/test/browser_test_base.cc
+++ b/content/public/test/browser_test_base.cc
@@ -12,8 +12,8 @@
#include "base/strings/string_number_conversions.h"
#include "base/sys_info.h"
#include "base/test/test_timeouts.h"
-#include "content/public/app/content_main.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
+#include "content/public/app/content_main.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
@@ -158,7 +158,6 @@ BrowserTestBase::~BrowserTestBase() {
void BrowserTestBase::SetUp() {
CommandLine* command_line = CommandLine::ForCurrentProcess();
-
// Override the child process connection timeout since tests can exceed that
// when sharded.
command_line->AppendSwitchASCII(
@@ -237,8 +236,12 @@ void BrowserTestBase::SetUp() {
rule_based_resolver_->AddSimulatedFailure("wpad");
net::ScopedDefaultHostResolverProc scoped_local_host_resolver_proc(
rule_based_resolver_.get());
+ for (ScopedVector<Admixture>::iterator it = admixtures_.begin();
+ it != admixtures_.end();
+ ++it) {
+ (*it)->SetUpInProcessBrowserTestFixture();
+ }
SetUpInProcessBrowserTestFixture();
-
base::Closure* ui_task =
new base::Closure(
base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this));
@@ -253,6 +256,11 @@ void BrowserTestBase::SetUp() {
EXPECT_EQ(expected_exit_code_, ContentMain(*GetContentMainParams()));
#endif
TearDownInProcessBrowserTestFixture();
+ for (ScopedVector<Admixture>::reverse_iterator it = admixtures_.rbegin();
+ it != admixtures_.rend();
+ ++it) {
+ (*it)->TearDownInProcessBrowserTestFixture();
+ }
}
void BrowserTestBase::TearDown() {
@@ -304,4 +312,12 @@ bool BrowserTestBase::UsingOSMesa() const {
gfx::kGLImplementationOSMesaName;
}
+void BrowserTestBase::AddAdmixture(BrowserTestBase::Admixture* admixture) {
+ admixtures_.push_back(admixture);
+}
+
+std::vector<BrowserTestBase::Admixture*> BrowserTestBase::GetAdmixtures() {
+ return admixtures_.get();
+}
+
} // namespace content
« no previous file with comments | « content/public/test/browser_test_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698