| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_TEST_WEBDRIVER_WEBDRIVER_UTIL_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_WEBDRIVER_UTIL_H_ |
| 6 #define CHROME_TEST_WEBDRIVER_WEBDRIVER_UTIL_H_ | 6 #define CHROME_TEST_WEBDRIVER_WEBDRIVER_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Returns the equivalent JSON string for the given value. | 27 // Returns the equivalent JSON string for the given value. |
| 28 std::string JsonStringify(const base::Value* value); | 28 std::string JsonStringify(const base::Value* value); |
| 29 | 29 |
| 30 // Returns the JSON string for the given value, with the exception that | 30 // Returns the JSON string for the given value, with the exception that |
| 31 // long strings are shortened for easier display. | 31 // long strings are shortened for easier display. |
| 32 std::string JsonStringifyForDisplay(const base::Value* value); | 32 std::string JsonStringifyForDisplay(const base::Value* value); |
| 33 | 33 |
| 34 // Returns the string representation of the given type, for display purposes. | 34 // Returns the string representation of the given type, for display purposes. |
| 35 const char* GetJsonTypeName(base::Value::Type type); | 35 const char* GetJsonTypeName(base::Value::Type type); |
| 36 | 36 |
| 37 // Converts the automation ID to a string. |
| 38 std::string AutomationIdToString(const AutomationId& id); |
| 39 |
| 37 // Converts the string to an automation ID and returns true on success. | 40 // Converts the string to an automation ID and returns true on success. |
| 38 bool StringToAutomationId(const std::string& string_id, AutomationId* id); | 41 bool StringToAutomationId(const std::string& string_id, AutomationId* id); |
| 39 | 42 |
| 40 // Converts the web view ID to a string. | 43 // Converts the web view ID to a string. |
| 41 std::string WebViewIdToString(const WebViewId& view_id); | 44 std::string WebViewIdToString(const WebViewId& view_id); |
| 42 | 45 |
| 43 // Converts the string to a web view ID and returns true on success. | 46 // Converts the string to a web view ID and returns true on success. |
| 44 bool StringToWebViewId(const std::string& string_id, WebViewId* view_id); | 47 bool StringToWebViewId(const std::string& string_id, WebViewId* view_id); |
| 45 | 48 |
| 46 // Flattens the given list of strings into one. | 49 // Flattens the given list of strings into one. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 101 |
| 99 // Value conversion traits for SkipParsing, which just return true. | 102 // Value conversion traits for SkipParsing, which just return true. |
| 100 template <> | 103 template <> |
| 101 struct ValueConversionTraits<webdriver::SkipParsing> { | 104 struct ValueConversionTraits<webdriver::SkipParsing> { |
| 102 static bool SetFromValue(const base::Value* value, | 105 static bool SetFromValue(const base::Value* value, |
| 103 const webdriver::SkipParsing* t); | 106 const webdriver::SkipParsing* t); |
| 104 static bool CanConvert(const base::Value* value); | 107 static bool CanConvert(const base::Value* value); |
| 105 }; | 108 }; |
| 106 | 109 |
| 107 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_UTIL_H_ | 110 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_UTIL_H_ |
| OLD | NEW |