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

Unified Diff: blimp/engine/testing/session/test_blimp_engine_session.cc

Issue 2572563006: [Blimp] Refactor Blimp test engine with embedded test server and URL rewriting (Closed)
Patch Set: nit change Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/engine/testing/session/test_blimp_engine_session.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/engine/testing/session/test_blimp_engine_session.cc
diff --git a/blimp/engine/testing/session/test_blimp_engine_session.cc b/blimp/engine/testing/session/test_blimp_engine_session.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9a549d7a173972c323136fdcdcec5323f7db79e1
--- /dev/null
+++ b/blimp/engine/testing/session/test_blimp_engine_session.cc
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "blimp/engine/testing/session/test_blimp_engine_session.h"
+
+#include <string>
+
+#include "content/public/browser/browser_url_handler.h"
+
+namespace blimp {
+namespace engine {
+
+TestBlimpEngineSession::TestBlimpEngineSession(
+ std::unique_ptr<BlimpBrowserContext> browser_context,
+ net::NetLog* net_log,
+ BlimpEngineConfig* engine_config,
+ SettingsManager* settings_manager)
+ : BlimpEngineSession(std::move(browser_context),
+ net_log,
+ engine_config,
+ settings_manager){}
+
+void TestBlimpEngineSession::ProcessMessage(
+ std::unique_ptr<BlimpMessage> message,
+ const net::CompletionCallback& callback) {
+ if (message->has_navigation() &&
+ message->navigation().type() == NavigationMessage::LOAD_URL) {
+ GURL url = GURL(message->navigation().load_url().url());
+ bool reverse_on_redirect = false;
+ content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
+ &url, browser_context(), &reverse_on_redirect);
+ message->mutable_navigation()->mutable_load_url()->set_url(url.spec());
+ }
+ BlimpEngineSession::ProcessMessage(std::move(message), callback);
+}
+
+} // namespace engine
+} // namespace blimp
« no previous file with comments | « blimp/engine/testing/session/test_blimp_engine_session.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698