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

Side by Side Diff: mojo/runner/about_fetcher_unittest.cc

Issue 1311353005: Adds a way to determine id of content handler that created app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks Created 5 years, 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "mojo/application/public/cpp/application_connection.h" 10 #include "mojo/application/public/cpp/application_connection.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // - TestContentHandler::StartApplication() has been called (please see 127 // - TestContentHandler::StartApplication() has been called (please see
128 // comments in that method); or 128 // comments in that method); or
129 // - the application manager fails to fetch the requested URL. 129 // - the application manager fails to fetch the requested URL.
130 service_provider.set_connection_error_handler( 130 service_provider.set_connection_error_handler(
131 [&run_loop]() { run_loop.Quit(); }); 131 [&run_loop]() { run_loop.Quit(); });
132 132
133 URLRequestPtr request(URLRequest::New()); 133 URLRequestPtr request(URLRequest::New());
134 request->url = url; 134 request->url = url;
135 application_manager_->ConnectToApplication( 135 application_manager_->ConnectToApplication(
136 nullptr, request.Pass(), std::string(), GURL(), 136 nullptr, request.Pass(), std::string(), GURL(),
137 shell::ApplicationManager::kInvalidContentHandlerID,
137 service_provider_request.Pass(), nullptr, shell::CapabilityFilter(), 138 service_provider_request.Pass(), nullptr, shell::CapabilityFilter(),
138 base::Closure()); 139 base::Closure(), shell::EmptyConnectCallback());
139 140
140 run_loop.Run(); 141 run_loop.Run();
141 } 142 }
142 143
143 // Overridden from testing::Test: 144 // Overridden from testing::Test:
144 void SetUp() override { 145 void SetUp() override {
145 application_manager_.reset(new shell::ApplicationManager(&test_delegate_)); 146 application_manager_.reset(new shell::ApplicationManager(&test_delegate_));
146 application_manager_->SetLoaderForURL( 147 application_manager_->SetLoaderForURL(
147 make_scoped_ptr(new TestLoader(&html_content_handler_)), 148 make_scoped_ptr(new TestLoader(&html_content_handler_)),
148 GURL("test:html_content_handler")); 149 GURL("test:html_content_handler"));
(...skipping 27 matching lines...) Expand all
176 177
177 TEST_F(AboutFetcherTest, UnrecognizedURL) { 178 TEST_F(AboutFetcherTest, UnrecognizedURL) {
178 ConnectAndWait("about:some_unrecognized_url"); 179 ConnectAndWait("about:some_unrecognized_url");
179 180
180 ASSERT_EQ(0u, html_content_handler()->response_number()); 181 ASSERT_EQ(0u, html_content_handler()->response_number());
181 } 182 }
182 183
183 } // namespace 184 } // namespace
184 } // namespace runner 185 } // namespace runner
185 } // namespace mojo 186 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698