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

Side by Side Diff: components/test_runner/test_runner.cc

Issue 2145873003: Initialize all parameters for MockDeviceMotion interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 836
837 void TestRunnerBindings::ResetDeviceLight() { 837 void TestRunnerBindings::ResetDeviceLight() {
838 if (runner_) 838 if (runner_)
839 runner_->ResetDeviceLight(); 839 runner_->ResetDeviceLight();
840 } 840 }
841 841
842 void TestRunnerBindings::SetMockDeviceMotion(gin::Arguments* args) { 842 void TestRunnerBindings::SetMockDeviceMotion(gin::Arguments* args) {
843 if (!runner_) 843 if (!runner_)
844 return; 844 return;
845 845
846 bool has_acceleration_x; 846 bool has_acceleration_x = false;
847 double acceleration_x; 847 double acceleration_x = 0.0;
848 bool has_acceleration_y; 848 bool has_acceleration_y = false;
849 double acceleration_y; 849 double acceleration_y = 0.0;
850 bool has_acceleration_z; 850 bool has_acceleration_z = false;
851 double acceleration_z; 851 double acceleration_z = 0.0;
852 bool has_acceleration_including_gravity_x; 852 bool has_acceleration_including_gravity_x = false;
853 double acceleration_including_gravity_x; 853 double acceleration_including_gravity_x = 0.0;
854 bool has_acceleration_including_gravity_y; 854 bool has_acceleration_including_gravity_y = false;
855 double acceleration_including_gravity_y; 855 double acceleration_including_gravity_y = 0.0;
856 bool has_acceleration_including_gravity_z; 856 bool has_acceleration_including_gravity_z = false;
857 double acceleration_including_gravity_z; 857 double acceleration_including_gravity_z = 0.0;
858 bool has_rotation_rate_alpha; 858 bool has_rotation_rate_alpha = false;
859 double rotation_rate_alpha; 859 double rotation_rate_alpha = 0.0;
860 bool has_rotation_rate_beta; 860 bool has_rotation_rate_beta = false;
861 double rotation_rate_beta; 861 double rotation_rate_beta = 0.0;
862 bool has_rotation_rate_gamma; 862 bool has_rotation_rate_gamma = false;
863 double rotation_rate_gamma; 863 double rotation_rate_gamma = 0.0;
864 double interval; 864 double interval = false;
865 865
866 args->GetNext(&has_acceleration_x); 866 args->GetNext(&has_acceleration_x);
867 args->GetNext(& acceleration_x); 867 args->GetNext(&acceleration_x);
868 args->GetNext(&has_acceleration_y); 868 args->GetNext(&has_acceleration_y);
869 args->GetNext(& acceleration_y); 869 args->GetNext(&acceleration_y);
870 args->GetNext(&has_acceleration_z); 870 args->GetNext(&has_acceleration_z);
871 args->GetNext(& acceleration_z); 871 args->GetNext(&acceleration_z);
872 args->GetNext(&has_acceleration_including_gravity_x); 872 args->GetNext(&has_acceleration_including_gravity_x);
873 args->GetNext(& acceleration_including_gravity_x); 873 args->GetNext(&acceleration_including_gravity_x);
874 args->GetNext(&has_acceleration_including_gravity_y); 874 args->GetNext(&has_acceleration_including_gravity_y);
875 args->GetNext(& acceleration_including_gravity_y); 875 args->GetNext(&acceleration_including_gravity_y);
876 args->GetNext(&has_acceleration_including_gravity_z); 876 args->GetNext(&has_acceleration_including_gravity_z);
877 args->GetNext(& acceleration_including_gravity_z); 877 args->GetNext(&acceleration_including_gravity_z);
878 args->GetNext(&has_rotation_rate_alpha); 878 args->GetNext(&has_rotation_rate_alpha);
879 args->GetNext(& rotation_rate_alpha); 879 args->GetNext(&rotation_rate_alpha);
880 args->GetNext(&has_rotation_rate_beta); 880 args->GetNext(&has_rotation_rate_beta);
881 args->GetNext(& rotation_rate_beta); 881 args->GetNext(&rotation_rate_beta);
882 args->GetNext(&has_rotation_rate_gamma); 882 args->GetNext(&has_rotation_rate_gamma);
883 args->GetNext(& rotation_rate_gamma); 883 args->GetNext(&rotation_rate_gamma);
884 args->GetNext(& interval); 884 args->GetNext(&interval);
885 885
886 runner_->SetMockDeviceMotion(has_acceleration_x, acceleration_x, 886 runner_->SetMockDeviceMotion(has_acceleration_x, acceleration_x,
887 has_acceleration_y, acceleration_y, 887 has_acceleration_y, acceleration_y,
888 has_acceleration_z, acceleration_z, 888 has_acceleration_z, acceleration_z,
889 has_acceleration_including_gravity_x, 889 has_acceleration_including_gravity_x,
890 acceleration_including_gravity_x, 890 acceleration_including_gravity_x,
891 has_acceleration_including_gravity_y, 891 has_acceleration_including_gravity_y,
892 acceleration_including_gravity_y, 892 acceleration_including_gravity_y,
893 has_acceleration_including_gravity_z, 893 has_acceleration_including_gravity_z,
894 acceleration_including_gravity_z, 894 acceleration_including_gravity_z,
(...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after
2733 2733
2734 void TestRunner::NotifyDone() { 2734 void TestRunner::NotifyDone() {
2735 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && 2735 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() &&
2736 work_queue_.is_empty()) 2736 work_queue_.is_empty())
2737 delegate_->TestFinished(); 2737 delegate_->TestFinished();
2738 layout_test_runtime_flags_.set_wait_until_done(false); 2738 layout_test_runtime_flags_.set_wait_until_done(false);
2739 OnLayoutTestRuntimeFlagsChanged(); 2739 OnLayoutTestRuntimeFlagsChanged();
2740 } 2740 }
2741 2741
2742 } // namespace test_runner 2742 } // namespace test_runner
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698