| 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 2639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2650 } else if (key == "WebKitWebSecurityEnabled") { | 2650 } else if (key == "WebKitWebSecurityEnabled") { |
| 2651 prefs->web_security_enabled = value->BooleanValue(); | 2651 prefs->web_security_enabled = value->BooleanValue(); |
| 2652 } else { | 2652 } else { |
| 2653 std::string message("Invalid name for preference: "); | 2653 std::string message("Invalid name for preference: "); |
| 2654 message.append(key); | 2654 message.append(key); |
| 2655 delegate_->PrintMessage(std::string("CONSOLE MESSAGE: ") + message + "\n"); | 2655 delegate_->PrintMessage(std::string("CONSOLE MESSAGE: ") + message + "\n"); |
| 2656 } | 2656 } |
| 2657 delegate_->ApplyPreferences(); | 2657 delegate_->ApplyPreferences(); |
| 2658 } | 2658 } |
| 2659 | 2659 |
| 2660 std::string TestRunner::GetAcceptLanguages() const { |
| 2661 return layout_test_runtime_flags_.accept_languages(); |
| 2662 } |
| 2663 |
| 2660 void TestRunner::SetAcceptLanguages(const std::string& accept_languages) { | 2664 void TestRunner::SetAcceptLanguages(const std::string& accept_languages) { |
| 2661 proxy_->SetAcceptLanguages(accept_languages); | 2665 if (accept_languages == GetAcceptLanguages()) |
| 2666 return; |
| 2667 |
| 2668 layout_test_runtime_flags_.set_accept_languages(accept_languages); |
| 2669 OnLayoutTestRuntimeFlagsChanged(); |
| 2670 proxy_->GetWebView()->acceptLanguagesChanged(); |
| 2662 } | 2671 } |
| 2663 | 2672 |
| 2664 void TestRunner::SetPluginsEnabled(bool enabled) { | 2673 void TestRunner::SetPluginsEnabled(bool enabled) { |
| 2665 delegate_->Preferences()->plugins_enabled = enabled; | 2674 delegate_->Preferences()->plugins_enabled = enabled; |
| 2666 delegate_->ApplyPreferences(); | 2675 delegate_->ApplyPreferences(); |
| 2667 } | 2676 } |
| 2668 | 2677 |
| 2669 bool TestRunner::AnimationScheduled() { | 2678 bool TestRunner::AnimationScheduled() { |
| 2670 return proxy_->AnimationScheduled(); | 2679 return proxy_->AnimationScheduled(); |
| 2671 } | 2680 } |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3243 } | 3252 } |
| 3244 | 3253 |
| 3245 void TestRunner::DidLosePointerLockInternal() { | 3254 void TestRunner::DidLosePointerLockInternal() { |
| 3246 bool was_locked = pointer_locked_; | 3255 bool was_locked = pointer_locked_; |
| 3247 pointer_locked_ = false; | 3256 pointer_locked_ = false; |
| 3248 if (was_locked) | 3257 if (was_locked) |
| 3249 web_view_->didLosePointerLock(); | 3258 web_view_->didLosePointerLock(); |
| 3250 } | 3259 } |
| 3251 | 3260 |
| 3252 } // namespace test_runner | 3261 } // namespace test_runner |
| OLD | NEW |