| 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_runner.h" | 5 #include "components/test_runner/test_runner.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #endif | 71 #endif |
| 72 | 72 |
| 73 using namespace blink; | 73 using namespace blink; |
| 74 | 74 |
| 75 namespace test_runner { | 75 namespace test_runner { |
| 76 | 76 |
| 77 namespace { | 77 namespace { |
| 78 | 78 |
| 79 WebString V8StringToWebString(v8::Local<v8::String> v8_str) { | 79 WebString V8StringToWebString(v8::Local<v8::String> v8_str) { |
| 80 int length = v8_str->Utf8Length() + 1; | 80 int length = v8_str->Utf8Length() + 1; |
| 81 scoped_ptr<char[]> chars(new char[length]); | 81 std::unique_ptr<char[]> chars(new char[length]); |
| 82 v8_str->WriteUtf8(chars.get(), length); | 82 v8_str->WriteUtf8(chars.get(), length); |
| 83 return WebString::fromUTF8(chars.get()); | 83 return WebString::fromUTF8(chars.get()); |
| 84 } | 84 } |
| 85 | 85 |
| 86 double GetDefaultDeviceScaleFactor() { | 86 double GetDefaultDeviceScaleFactor() { |
| 87 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 87 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 88 if (command_line->HasSwitch(switches::kForceDeviceScaleFactor)) { | 88 if (command_line->HasSwitch(switches::kForceDeviceScaleFactor)) { |
| 89 double scale; | 89 double scale; |
| 90 std::string value = | 90 std::string value = |
| 91 command_line->GetSwitchValueASCII(switches::kForceDeviceScaleFactor); | 91 command_line->GetSwitchValueASCII(switches::kForceDeviceScaleFactor); |
| (...skipping 3193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3285 } | 3285 } |
| 3286 | 3286 |
| 3287 void TestRunner::DidLosePointerLockInternal() { | 3287 void TestRunner::DidLosePointerLockInternal() { |
| 3288 bool was_locked = pointer_locked_; | 3288 bool was_locked = pointer_locked_; |
| 3289 pointer_locked_ = false; | 3289 pointer_locked_ = false; |
| 3290 if (was_locked) | 3290 if (was_locked) |
| 3291 web_view_->didLosePointerLock(); | 3291 web_view_->didLosePointerLock(); |
| 3292 } | 3292 } |
| 3293 | 3293 |
| 3294 } // namespace test_runner | 3294 } // namespace test_runner |
| OLD | NEW |