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

Side by Side Diff: content/shell/renderer/test_runner/TestCommon.cpp

Issue 436133002: Migrate TestCommon to Chromium c++ style and remove un-used header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated for layout test Created 6 years, 4 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
(Empty)
1 // Copyright 2013 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 "content/shell/renderer/test_runner/TestCommon.h"
6
7 namespace content {
8
9 namespace {
10
11 const char layoutTestsPattern[] = "/LayoutTests/";
12 const std::string::size_type layoutTestsPatternSize = sizeof(layoutTestsPattern) - 1;
13 const char fileUrlPattern[] = "file:/";
14 const char fileTestPrefix[] = "(file test):";
15 const char dataUrlPattern[] = "data:";
16 const std::string::size_type dataUrlPatternSize = sizeof(dataUrlPattern) - 1;
17
18 } // namespace
19
20 std::string normalizeLayoutTestURL(const std::string& url)
21 {
22 std::string result = url;
23 size_t pos;
24 if (!url.find(fileUrlPattern) && ((pos = url.find(layoutTestsPattern)) != st d::string::npos)) {
25 // adjust file URLs to match upstream results.
26 result.replace(0, pos + layoutTestsPatternSize, fileTestPrefix);
27 } else if (!url.find(dataUrlPattern)) {
28 // URL-escape data URLs to match results upstream.
29 std::string path = url.substr(dataUrlPatternSize);
30 result.replace(dataUrlPatternSize, url.length(), path);
31 }
32 return result;
33 }
34
35 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/TestCommon.h ('k') | content/shell/renderer/test_runner/TestPlugin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698