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

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

Issue 110533009: Import TestRunner library into chromium. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates 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
(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 using namespace std;
8
9 namespace WebTestRunner {
10
11 namespace {
12
13 const char layoutTestsPattern[] = "/LayoutTests/";
14 const string::size_type layoutTestsPatternSize = sizeof(layoutTestsPattern) - 1;
15 const char fileUrlPattern[] = "file:/";
16 const char fileTestPrefix[] = "(file test):";
17 const char dataUrlPattern[] = "data:";
18 const string::size_type dataUrlPatternSize = sizeof(dataUrlPattern) - 1;
19
20 }
21
22 string normalizeLayoutTestURL(const string& url)
23 {
24 string result = url;
25 size_t pos;
26 if (!url.find(fileUrlPattern) && ((pos = url.find(layoutTestsPattern)) != st ring::npos)) {
27 // adjust file URLs to match upstream results.
28 result.replace(0, pos + layoutTestsPatternSize, fileTestPrefix);
29 } else if (!url.find(dataUrlPattern)) {
30 // URL-escape data URLs to match results upstream.
31 string path = url.substr(dataUrlPatternSize);
32 result.replace(dataUrlPatternSize, url.length(), path);
33 }
34 return result;
35 }
36
37 }
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/TestCommon.h ('k') | content/shell/renderer/test_runner/TestInterfaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698