Chromium Code Reviews| 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 2635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2646 } else if (key == "WebKitWebSecurityEnabled") { | 2646 } else if (key == "WebKitWebSecurityEnabled") { |
| 2647 prefs->web_security_enabled = value->BooleanValue(); | 2647 prefs->web_security_enabled = value->BooleanValue(); |
| 2648 } else { | 2648 } else { |
| 2649 std::string message("Invalid name for preference: "); | 2649 std::string message("Invalid name for preference: "); |
| 2650 message.append(key); | 2650 message.append(key); |
| 2651 delegate_->PrintMessage(std::string("CONSOLE MESSAGE: ") + message + "\n"); | 2651 delegate_->PrintMessage(std::string("CONSOLE MESSAGE: ") + message + "\n"); |
| 2652 } | 2652 } |
| 2653 delegate_->ApplyPreferences(); | 2653 delegate_->ApplyPreferences(); |
| 2654 } | 2654 } |
| 2655 | 2655 |
| 2656 std::string TestRunner::GetAcceptLanguages() const { | |
| 2657 return layout_test_runtime_flags_.accept_languages(); | |
| 2658 } | |
| 2659 | |
| 2656 void TestRunner::SetAcceptLanguages(const std::string& accept_languages) { | 2660 void TestRunner::SetAcceptLanguages(const std::string& accept_languages) { |
| 2657 proxy_->SetAcceptLanguages(accept_languages); | 2661 if (accept_languages == GetAcceptLanguages()) |
| 2662 return; | |
|
Łukasz Anforowicz
2016/03/25 14:37:59
Turns out that we really need to copy this check f
| |
| 2663 | |
| 2664 layout_test_runtime_flags_.set_accept_languages(accept_languages); | |
| 2665 OnLayoutTestRuntimeFlagsChanged(); | |
| 2666 proxy_->GetWebView()->acceptLanguagesChanged(); | |
| 2658 } | 2667 } |
| 2659 | 2668 |
| 2660 void TestRunner::SetPluginsEnabled(bool enabled) { | 2669 void TestRunner::SetPluginsEnabled(bool enabled) { |
| 2661 delegate_->Preferences()->plugins_enabled = enabled; | 2670 delegate_->Preferences()->plugins_enabled = enabled; |
| 2662 delegate_->ApplyPreferences(); | 2671 delegate_->ApplyPreferences(); |
| 2663 } | 2672 } |
| 2664 | 2673 |
| 2665 bool TestRunner::AnimationScheduled() { | 2674 bool TestRunner::AnimationScheduled() { |
| 2666 return proxy_->AnimationScheduled(); | 2675 return proxy_->AnimationScheduled(); |
| 2667 } | 2676 } |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3239 } | 3248 } |
| 3240 | 3249 |
| 3241 void TestRunner::DidLosePointerLockInternal() { | 3250 void TestRunner::DidLosePointerLockInternal() { |
| 3242 bool was_locked = pointer_locked_; | 3251 bool was_locked = pointer_locked_; |
| 3243 pointer_locked_ = false; | 3252 pointer_locked_ = false; |
| 3244 if (was_locked) | 3253 if (was_locked) |
| 3245 web_view_->didLosePointerLock(); | 3254 web_view_->didLosePointerLock(); |
| 3246 } | 3255 } |
| 3247 | 3256 |
| 3248 } // namespace test_runner | 3257 } // namespace test_runner |
| OLD | NEW |