OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_TEST_RUNNER_TEST_COMMON_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_TEST_COMMON_H_ |
6 #define COMPONENTS_TEST_RUNNER_TEST_COMMON_H_ | 6 #define COMPONENTS_TEST_RUNNER_TEST_COMMON_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "base/strings/string_util.h" |
10 #include "components/test_runner/test_runner_export.h" | 11 #include "components/test_runner/test_runner_export.h" |
11 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" | 12 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" |
12 | 13 |
13 class GURL; | 14 class GURL; |
14 | 15 |
15 namespace test_runner { | 16 namespace test_runner { |
16 | 17 |
17 inline bool IsASCIIAlpha(char ch) { | 18 inline bool IsASCIIAlpha(char ch) { |
18 return (ch | 0x20) >= 'a' && (ch | 0x20) <= 'z'; | 19 return base::IsAsciiLower(ch | 0x20); |
19 } | 20 } |
20 | 21 |
21 inline bool IsNotASCIIAlpha(char ch) { | 22 inline bool IsNotASCIIAlpha(char ch) { |
22 return !IsASCIIAlpha(ch); | 23 return !IsASCIIAlpha(ch); |
23 } | 24 } |
24 | 25 |
25 TEST_RUNNER_EXPORT std::string NormalizeLayoutTestURL(const std::string& url); | 26 TEST_RUNNER_EXPORT std::string NormalizeLayoutTestURL(const std::string& url); |
26 | 27 |
27 std::string URLDescription(const GURL& url); | 28 std::string URLDescription(const GURL& url); |
28 const char* WebNavigationPolicyToString( | 29 const char* WebNavigationPolicyToString( |
29 const blink::WebNavigationPolicy& policy); | 30 const blink::WebNavigationPolicy& policy); |
30 | 31 |
31 // Tests which depend on Blink must call this function on the main thread | 32 // Tests which depend on Blink must call this function on the main thread |
32 // before creating/calling any Blink objects/APIs. | 33 // before creating/calling any Blink objects/APIs. |
33 TEST_RUNNER_EXPORT void EnsureBlinkInitialized(); | 34 TEST_RUNNER_EXPORT void EnsureBlinkInitialized(); |
34 | 35 |
35 } // namespace test_runner | 36 } // namespace test_runner |
36 | 37 |
37 #endif // COMPONENTS_TEST_RUNNER_TEST_COMMON_H_ | 38 #endif // COMPONENTS_TEST_RUNNER_TEST_COMMON_H_ |
OLD | NEW |