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

Side by Side Diff: ios/web/webui/crw_web_ui_manager_unittest.mm

Issue 2340343002: [ARC] Converts part of ios/web/ui to ARC. (Closed)
Patch Set: Fixes unit test Created 4 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
« no previous file with comments | « ios/web/webui/crw_web_ui_manager.mm ('k') | ios/web/webui/crw_web_ui_page_builder.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import "ios/web/webui/crw_web_ui_manager.h" 5 #import "ios/web/webui/crw_web_ui_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 // Mock of URLFetcherBlockAdapter to provide mock resources. 63 // Mock of URLFetcherBlockAdapter to provide mock resources.
64 class MockURLFetcherBlockAdapter : public URLFetcherBlockAdapter { 64 class MockURLFetcherBlockAdapter : public URLFetcherBlockAdapter {
65 public: 65 public:
66 MockURLFetcherBlockAdapter( 66 MockURLFetcherBlockAdapter(
67 const GURL& url, 67 const GURL& url,
68 net::URLRequestContextGetter* request_context, 68 net::URLRequestContextGetter* request_context,
69 URLFetcherBlockAdapterCompletion completion_handler) 69 URLFetcherBlockAdapterCompletion completion_handler)
70 : URLFetcherBlockAdapter(url, request_context, completion_handler), 70 : URLFetcherBlockAdapter(url, request_context, completion_handler),
71 url_(url), 71 url_(url),
72 completion_handler_(completion_handler) {} 72 completion_handler_([completion_handler copy]) {}
73 73
74 void Start() override { 74 void Start() override {
75 if (url_.spec() == kFaviconUrl) { 75 if (url_.spec() == kFaviconUrl) {
76 base::FilePath favicon_path; 76 base::FilePath favicon_path;
77 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &favicon_path)); 77 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &favicon_path));
78 favicon_path = favicon_path.AppendASCII(kFaviconPath); 78 favicon_path = favicon_path.AppendASCII(kFaviconPath);
79 NSData* favicon = [NSData 79 NSData* favicon = [NSData
80 dataWithContentsOfFile:base::SysUTF8ToNSString(favicon_path.value())]; 80 dataWithContentsOfFile:base::SysUTF8ToNSString(favicon_path.value())];
81 completion_handler_.get()(favicon, this); 81 completion_handler_.get()(favicon, this);
82 } else if (url_.path().find(kMojoModuleName) != std::string::npos) { 82 } else if (url_.path().find(kMojoModuleName) != std::string::npos) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 "%s__crWeb.webUIModuleLoadNotifier.moduleLoadCompleted(\"%s\", \"%s\");", 195 "%s__crWeb.webUIModuleLoadNotifier.moduleLoadCompleted(\"%s\", \"%s\");",
196 base::SysNSStringToUTF8(kMojoModule).c_str(), kMojoModuleName, 196 base::SysNSStringToUTF8(kMojoModule).c_str(), kMojoModuleName,
197 kTestLoadId); 197 kTestLoadId);
198 198
199 EXPECT_CALL(*web_state_impl_, 199 EXPECT_CALL(*web_state_impl_,
200 ExecuteJavaScript(base::UTF8ToUTF16(expected_javascript))); 200 ExecuteJavaScript(base::UTF8ToUTF16(expected_javascript)));
201 web_state_impl_->OnScriptCommandReceived("webui.loadMojo", message, 201 web_state_impl_->OnScriptCommandReceived("webui.loadMojo", message,
202 GURL(kTestWebUIUrl), false); 202 GURL(kTestWebUIUrl), false);
203 } 203 }
204 } // namespace web 204 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/webui/crw_web_ui_manager.mm ('k') | ios/web/webui/crw_web_ui_page_builder.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698