Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(708)

Side by Side Diff: content/shell/renderer/test_runner/test_runner.cc

Issue 458723002: TestInterfaces to chromium c++ style, rename methods and remove un-used header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/shell/renderer/test_runner/test_runner.h" 5 #include "content/shell/renderer/test_runner/test_runner.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/shell/common/test_runner/test_preferences.h" 10 #include "content/shell/common/test_runner/test_preferences.h"
11 #include "content/shell/renderer/test_runner/TestInterfaces.h"
12 #include "content/shell/renderer/test_runner/WebTestDelegate.h" 11 #include "content/shell/renderer/test_runner/WebTestDelegate.h"
13 #include "content/shell/renderer/test_runner/mock_web_push_client.h" 12 #include "content/shell/renderer/test_runner/mock_web_push_client.h"
14 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" 13 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h"
15 #include "content/shell/renderer/test_runner/notification_presenter.h" 14 #include "content/shell/renderer/test_runner/notification_presenter.h"
15 #include "content/shell/renderer/test_runner/test_interfaces.h"
16 #include "content/shell/renderer/test_runner/web_permissions.h" 16 #include "content/shell/renderer/test_runner/web_permissions.h"
17 #include "content/shell/renderer/test_runner/web_test_proxy.h" 17 #include "content/shell/renderer/test_runner/web_test_proxy.h"
18 #include "gin/arguments.h" 18 #include "gin/arguments.h"
19 #include "gin/array_buffer.h" 19 #include "gin/array_buffer.h"
20 #include "gin/handle.h" 20 #include "gin/handle.h"
21 #include "gin/object_template_builder.h" 21 #include "gin/object_template_builder.h"
22 #include "gin/wrappable.h" 22 #include "gin/wrappable.h"
23 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" 23 #include "third_party/WebKit/public/platform/WebArrayBuffer.h"
24 #include "third_party/WebKit/public/platform/WebBatteryStatus.h" 24 #include "third_party/WebKit/public/platform/WebBatteryStatus.h"
25 #include "third_party/WebKit/public/platform/WebCanvas.h" 25 #include "third_party/WebKit/public/platform/WebCanvas.h"
(...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 args->GetNext(&policy_delegate_is_permissive_); 2069 args->GetNext(&policy_delegate_is_permissive_);
2070 } 2070 }
2071 2071
2072 void TestRunner::WaitForPolicyDelegate() { 2072 void TestRunner::WaitForPolicyDelegate() {
2073 policy_delegate_enabled_ = true; 2073 policy_delegate_enabled_ = true;
2074 policy_delegate_should_notify_done_ = true; 2074 policy_delegate_should_notify_done_ = true;
2075 wait_until_done_ = true; 2075 wait_until_done_ = true;
2076 } 2076 }
2077 2077
2078 int TestRunner::WindowCount() { 2078 int TestRunner::WindowCount() {
2079 return test_interfaces_->windowList().size(); 2079 return test_interfaces_->GetWindowList().size();
2080 } 2080 }
2081 2081
2082 void TestRunner::SetCloseRemainingWindowsWhenComplete( 2082 void TestRunner::SetCloseRemainingWindowsWhenComplete(
2083 bool close_remaining_windows) { 2083 bool close_remaining_windows) {
2084 close_remaining_windows_ = close_remaining_windows; 2084 close_remaining_windows_ = close_remaining_windows;
2085 } 2085 }
2086 2086
2087 void TestRunner::ResetTestHelperControllers() { 2087 void TestRunner::ResetTestHelperControllers() {
2088 test_interfaces_->resetTestHelperControllers(); 2088 test_interfaces_->ResetTestHelperControllers();
2089 } 2089 }
2090 2090
2091 void TestRunner::SetTabKeyCyclesThroughElements( 2091 void TestRunner::SetTabKeyCyclesThroughElements(
2092 bool tab_key_cycles_through_elements) { 2092 bool tab_key_cycles_through_elements) {
2093 web_view_->setTabKeyCyclesThroughElements(tab_key_cycles_through_elements); 2093 web_view_->setTabKeyCyclesThroughElements(tab_key_cycles_through_elements);
2094 } 2094 }
2095 2095
2096 void TestRunner::ExecCommand(gin::Arguments* args) { 2096 void TestRunner::ExecCommand(gin::Arguments* args) {
2097 std::string command; 2097 std::string command;
2098 args->GetNext(&command); 2098 args->GetNext(&command);
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
2737 void TestRunner::SetPOSIXLocale(const std::string& locale) { 2737 void TestRunner::SetPOSIXLocale(const std::string& locale) {
2738 delegate_->setLocale(locale); 2738 delegate_->setLocale(locale);
2739 } 2739 }
2740 2740
2741 void TestRunner::SetMIDIAccessorResult(bool result) { 2741 void TestRunner::SetMIDIAccessorResult(bool result) {
2742 midi_accessor_result_ = result; 2742 midi_accessor_result_ = result;
2743 } 2743 }
2744 2744
2745 void TestRunner::SetMIDISysexPermission(bool value) { 2745 void TestRunner::SetMIDISysexPermission(bool value) {
2746 const std::vector<WebTestProxyBase*>& windowList = 2746 const std::vector<WebTestProxyBase*>& windowList =
2747 test_interfaces_->windowList(); 2747 test_interfaces_->GetWindowList();
2748 for (unsigned i = 0; i < windowList.size(); ++i) 2748 for (unsigned i = 0; i < windowList.size(); ++i)
2749 windowList.at(i)->GetMIDIClientMock()->setSysexPermission(value); 2749 windowList.at(i)->GetMIDIClientMock()->setSysexPermission(value);
2750 } 2750 }
2751 2751
2752 void TestRunner::GrantWebNotificationPermission(const GURL& origin, 2752 void TestRunner::GrantWebNotificationPermission(const GURL& origin,
2753 bool permission_granted) { 2753 bool permission_granted) {
2754 delegate_->grantWebNotificationPermission(origin, permission_granted); 2754 delegate_->grantWebNotificationPermission(origin, permission_granted);
2755 } 2755 }
2756 2756
2757 void TestRunner::ClearWebNotificationPermissions() { 2757 void TestRunner::ClearWebNotificationPermissions() {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
2923 } 2923 }
2924 2924
2925 void TestRunner::DidLosePointerLockInternal() { 2925 void TestRunner::DidLosePointerLockInternal() {
2926 bool was_locked = pointer_locked_; 2926 bool was_locked = pointer_locked_;
2927 pointer_locked_ = false; 2927 pointer_locked_ = false;
2928 if (was_locked) 2928 if (was_locked)
2929 web_view_->didLosePointerLock(); 2929 web_view_->didLosePointerLock();
2930 } 2930 }
2931 2931
2932 } // namespace content 2932 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/test_interfaces.cc ('k') | content/shell/renderer/test_runner/web_frame_test_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698