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

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

Issue 101113004: Revert 239759 "The comment in base64.h implies that base::Base64..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 | Annotate | Revision Log
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 base::Base64Encode(contents, &contents_base64); 295 if (!base::Base64Encode(contents, &contents_base64))
296 return WebURL();
296 297
297 const char data_url_prefix[] = "data:text/css:charset=utf-8;base64,"; 298 const char data_url_prefix[] = "data:text/css:charset=utf-8;base64,";
298 return WebURL(GURL(data_url_prefix + contents_base64)); 299 return WebURL(GURL(data_url_prefix + contents_base64));
299 } 300 }
300 301
301 WebURL WebKitTestRunner::rewriteLayoutTestsURL(const std::string& utf8_url) { 302 WebURL WebKitTestRunner::rewriteLayoutTestsURL(const std::string& utf8_url) {
302 const char kPrefix[] = "file:///tmp/LayoutTests/"; 303 const char kPrefix[] = "file:///tmp/LayoutTests/";
303 const int kPrefixLen = arraysize(kPrefix) - 1; 304 const int kPrefixLen = arraysize(kPrefix) - 1;
304 305
305 if (utf8_url.compare(0, kPrefixLen, kPrefix, kPrefixLen)) 306 if (utf8_url.compare(0, kPrefixLen, kPrefix, kPrefixLen))
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 WebURLRequest(GURL(kAboutBlankURL))); 695 WebURLRequest(GURL(kAboutBlankURL)));
695 Send(new ShellViewHostMsg_ResetDone(routing_id())); 696 Send(new ShellViewHostMsg_ResetDone(routing_id()));
696 } 697 }
697 698
698 void WebKitTestRunner::OnNotifyDone() { 699 void WebKitTestRunner::OnNotifyDone() {
699 render_view()->GetWebView()->mainFrame()->executeScript( 700 render_view()->GetWebView()->mainFrame()->executeScript(
700 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); 701 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();")));
701 } 702 }
702 703
703 } // namespace content 704 } // namespace content
OLDNEW
« no previous file with comments | « trunk/src/content/shell/browser/webkit_test_controller.cc ('k') | trunk/src/extensions/common/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698