| 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 #include "components/test_runner/test_common.h" | 5 #include "components/test_runner/test_common.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return kPolicyNewForegroundTab; | 92 return kPolicyNewForegroundTab; |
| 93 case blink::WebNavigationPolicyNewWindow: | 93 case blink::WebNavigationPolicyNewWindow: |
| 94 return kPolicyNewWindow; | 94 return kPolicyNewWindow; |
| 95 case blink::WebNavigationPolicyNewPopup: | 95 case blink::WebNavigationPolicyNewPopup: |
| 96 return kPolicyNewPopup; | 96 return kPolicyNewPopup; |
| 97 default: | 97 default: |
| 98 return kIllegalString; | 98 return kIllegalString; |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 blink::WebString V8StringToWebString(v8::Local<v8::String> v8_str) { |
| 103 int length = v8_str->Utf8Length() + 1; |
| 104 std::unique_ptr<char[]> chars(new char[length]); |
| 105 v8_str->WriteUtf8(chars.get(), length); |
| 106 return blink::WebString::fromUTF8(chars.get()); |
| 107 } |
| 108 |
| 102 void EnsureBlinkInitialized() { | 109 void EnsureBlinkInitialized() { |
| 103 g_mock_blink_platform.Get(); | 110 g_mock_blink_platform.Get(); |
| 104 } | 111 } |
| 105 | 112 |
| 106 } // namespace test_runner | 113 } // namespace test_runner |
| OLD | NEW |