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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "blimp/engine/testing/session/test_blimp_engine_session.h"
6
7 #include <string>
8
9 #include "content/public/browser/browser_url_handler.h"
10
11 namespace blimp {
12 namespace engine {
13
14 TestBlimpEngineSession::TestBlimpEngineSession(
15 std::unique_ptr<BlimpBrowserContext> browser_context,
16 net::NetLog* net_log,
17 BlimpEngineConfig* engine_config,
18 SettingsManager* settings_manager)
19 : BlimpEngineSession(std::move(browser_context),
20 net_log,
21 engine_config,
22 settings_manager){}
23
24 void TestBlimpEngineSession::ProcessMessage(
25 std::unique_ptr<BlimpMessage> message,
26 const net::CompletionCallback& callback) {
27 if (message->has_navigation() &&
28 message->navigation().type() == NavigationMessage::LOAD_URL) {
29 GURL url = GURL(message->navigation().load_url().url());
30 bool reverse_on_redirect = false;
31 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
32 &url, browser_context(), &reverse_on_redirect);
33 message->mutable_navigation()->mutable_load_url()->set_url(url.spec());
34 }
35 BlimpEngineSession::ProcessMessage(std::move(message), callback);
36 }
37
38 } // namespace engine
39 } // namespace blimp
OLDNEW
« 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