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

Side by Side Diff: content/shell/renderer/webkit_test_runner.cc

Issue 86913002: Make base::Base64Encode() return void (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: One more chromeos-specific fix. Created 7 years 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 | « content/shell/browser/webkit_test_controller.cc ('k') | extensions/common/extension.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/shell/renderer/webkit_test_runner.h" 5 #include "content/shell/renderer/webkit_test_runner.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <clocale> 8 #include <clocale>
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 WebURL WebKitTestRunner::localFileToDataURL(const WebURL& file_url) { 285 WebURL WebKitTestRunner::localFileToDataURL(const WebURL& file_url) {
286 base::FilePath local_path; 286 base::FilePath local_path;
287 if (!net::FileURLToFilePath(file_url, &local_path)) 287 if (!net::FileURLToFilePath(file_url, &local_path))
288 return WebURL(); 288 return WebURL();
289 289
290 std::string contents; 290 std::string contents;
291 Send(new ShellViewHostMsg_ReadFileToString( 291 Send(new ShellViewHostMsg_ReadFileToString(
292 routing_id(), local_path, &contents)); 292 routing_id(), local_path, &contents));
293 293
294 std::string contents_base64; 294 std::string contents_base64;
295 if (!base::Base64Encode(contents, &contents_base64)) 295 base::Base64Encode(contents, &contents_base64);
296 return WebURL();
297 296
298 const char data_url_prefix[] = "data:text/css:charset=utf-8;base64,"; 297 const char data_url_prefix[] = "data:text/css:charset=utf-8;base64,";
299 return WebURL(GURL(data_url_prefix + contents_base64)); 298 return WebURL(GURL(data_url_prefix + contents_base64));
300 } 299 }
301 300
302 WebURL WebKitTestRunner::rewriteLayoutTestsURL(const std::string& utf8_url) { 301 WebURL WebKitTestRunner::rewriteLayoutTestsURL(const std::string& utf8_url) {
303 const char kPrefix[] = "file:///tmp/LayoutTests/"; 302 const char kPrefix[] = "file:///tmp/LayoutTests/";
304 const int kPrefixLen = arraysize(kPrefix) - 1; 303 const int kPrefixLen = arraysize(kPrefix) - 1;
305 304
306 if (utf8_url.compare(0, kPrefixLen, kPrefix, kPrefixLen)) 305 if (utf8_url.compare(0, kPrefixLen, kPrefix, kPrefixLen))
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 WebURLRequest(GURL(kAboutBlankURL))); 694 WebURLRequest(GURL(kAboutBlankURL)));
696 Send(new ShellViewHostMsg_ResetDone(routing_id())); 695 Send(new ShellViewHostMsg_ResetDone(routing_id()));
697 } 696 }
698 697
699 void WebKitTestRunner::OnNotifyDone() { 698 void WebKitTestRunner::OnNotifyDone() {
700 render_view()->GetWebView()->mainFrame()->executeScript( 699 render_view()->GetWebView()->mainFrame()->executeScript(
701 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); 700 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();")));
702 } 701 }
703 702
704 } // namespace content 703 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/webkit_test_controller.cc ('k') | extensions/common/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698