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

Unified Diff: blimp/engine/app/blimp_content_main_delegate.cc

Issue 1929723002: [Blimp] Adds blimp engine browser test framework and LoadUrl test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update gn and deps Created 4 years, 7 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
Index: blimp/engine/app/blimp_content_main_delegate.cc
diff --git a/blimp/engine/app/blimp_content_main_delegate.cc b/blimp/engine/app/blimp_content_main_delegate.cc
index 6e7b445ad4ca90bf93f68ddabc470db80543ed17..4e646ade8c898a1e7c4256b768ff528a0d3f3e4c 100644
--- a/blimp/engine/app/blimp_content_main_delegate.cc
+++ b/blimp/engine/app/blimp_content_main_delegate.cc
@@ -31,6 +31,9 @@ base::LazyInstance<BlimpEngineCrashReporterClient>
g_blimp_engine_crash_reporter_client = LAZY_INSTANCE_INITIALIZER;
namespace {
+
+BlimpContentMainDelegate* g_content_main_delegate = nullptr;
Kevin M 2016/05/05 20:28:51 I don't think we should be adding test-hook single
haibinlu 2016/05/05 22:41:36 Done.
+
void InitLogging() {
// TODO(haibinlu): Remove this before release.
// Enables a few verbose log by default.
@@ -54,9 +57,20 @@ void InitLogging() {
}
} // namespace
-BlimpContentMainDelegate::BlimpContentMainDelegate() {}
+BlimpContentMainDelegate::BlimpContentMainDelegate() {
+ DCHECK(!g_content_main_delegate);
+ g_content_main_delegate = this;
+}
-BlimpContentMainDelegate::~BlimpContentMainDelegate() {}
+BlimpContentMainDelegate::~BlimpContentMainDelegate() {
+ DCHECK_EQ(this, g_content_main_delegate);
+ g_content_main_delegate = nullptr;
+}
+
+BlimpContentBrowserClient*
+BlimpContentMainDelegate::GetBlimpContentBrowserClient() {
+ return browser_client_.get();
+}
bool BlimpContentMainDelegate::BasicStartupComplete(int* exit_code) {
InitLogging();
@@ -77,6 +91,11 @@ void BlimpContentMainDelegate::PreSandboxStartup() {
InitializeResourceBundle();
}
+// static
+BlimpContentMainDelegate* BlimpContentMainDelegate::GetInstanceForTesting() {
+ return g_content_main_delegate;
+}
+
void BlimpContentMainDelegate::InitializeResourceBundle() {
base::FilePath pak_file;
bool pak_file_valid = PathService::Get(base::DIR_MODULE, &pak_file);

Powered by Google App Engine
This is Rietveld 408576698