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

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

Issue 1456753002: Compute the popup location/size correctly when use-zoom-for-dsf is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update TestExpectations Created 5 years 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 | « components/test_runner/test_runner.h ('k') | components/test_runner/web_test_delegate.h » ('j') | 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 <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 void CloseWebInspector(); 265 void CloseWebInspector();
266 bool IsChooserShown(); 266 bool IsChooserShown();
267 void EvaluateInWebInspector(int call_id, const std::string& script); 267 void EvaluateInWebInspector(int call_id, const std::string& script);
268 std::string EvaluateInWebInspectorOverlay(const std::string& script); 268 std::string EvaluateInWebInspectorOverlay(const std::string& script);
269 void ClearAllDatabases(); 269 void ClearAllDatabases();
270 void SetDatabaseQuota(int quota); 270 void SetDatabaseQuota(int quota);
271 void SetAlwaysAcceptCookies(bool accept); 271 void SetAlwaysAcceptCookies(bool accept);
272 void SetWindowIsKey(bool value); 272 void SetWindowIsKey(bool value);
273 std::string PathToLocalResource(const std::string& path); 273 std::string PathToLocalResource(const std::string& path);
274 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback); 274 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback);
275 void EnableUseZoomForDSF(v8::Local<v8::Function> callback);
275 void SetColorProfile(const std::string& name, 276 void SetColorProfile(const std::string& name,
276 v8::Local<v8::Function> callback); 277 v8::Local<v8::Function> callback);
277 void SetPOSIXLocale(const std::string& locale); 278 void SetPOSIXLocale(const std::string& locale);
278 void SetMIDIAccessorResult(bool result); 279 void SetMIDIAccessorResult(bool result);
279 void SimulateWebNotificationClick(gin::Arguments* args); 280 void SimulateWebNotificationClick(gin::Arguments* args);
280 void AddMockSpeechRecognitionResult(const std::string& transcript, 281 void AddMockSpeechRecognitionResult(const std::string& transcript,
281 double confidence); 282 double confidence);
282 void SetMockSpeechRecognitionError(const std::string& error, 283 void SetMockSpeechRecognitionError(const std::string& error,
283 const std::string& message); 284 const std::string& message);
284 bool WasMockSpeechRecognitionAborted(); 285 bool WasMockSpeechRecognitionAborted();
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 &TestRunnerBindings::EvaluateInWebInspectorOverlay) 539 &TestRunnerBindings::EvaluateInWebInspectorOverlay)
539 .SetMethod("clearAllDatabases", &TestRunnerBindings::ClearAllDatabases) 540 .SetMethod("clearAllDatabases", &TestRunnerBindings::ClearAllDatabases)
540 .SetMethod("setDatabaseQuota", &TestRunnerBindings::SetDatabaseQuota) 541 .SetMethod("setDatabaseQuota", &TestRunnerBindings::SetDatabaseQuota)
541 .SetMethod("setAlwaysAcceptCookies", 542 .SetMethod("setAlwaysAcceptCookies",
542 &TestRunnerBindings::SetAlwaysAcceptCookies) 543 &TestRunnerBindings::SetAlwaysAcceptCookies)
543 .SetMethod("setWindowIsKey", &TestRunnerBindings::SetWindowIsKey) 544 .SetMethod("setWindowIsKey", &TestRunnerBindings::SetWindowIsKey)
544 .SetMethod("pathToLocalResource", 545 .SetMethod("pathToLocalResource",
545 &TestRunnerBindings::PathToLocalResource) 546 &TestRunnerBindings::PathToLocalResource)
546 .SetMethod("setBackingScaleFactor", 547 .SetMethod("setBackingScaleFactor",
547 &TestRunnerBindings::SetBackingScaleFactor) 548 &TestRunnerBindings::SetBackingScaleFactor)
549 .SetMethod("enableUseZoomForDSF",
550 &TestRunnerBindings::EnableUseZoomForDSF)
548 .SetMethod("setColorProfile", &TestRunnerBindings::SetColorProfile) 551 .SetMethod("setColorProfile", &TestRunnerBindings::SetColorProfile)
549 .SetMethod("setPOSIXLocale", &TestRunnerBindings::SetPOSIXLocale) 552 .SetMethod("setPOSIXLocale", &TestRunnerBindings::SetPOSIXLocale)
550 .SetMethod("setMIDIAccessorResult", 553 .SetMethod("setMIDIAccessorResult",
551 &TestRunnerBindings::SetMIDIAccessorResult) 554 &TestRunnerBindings::SetMIDIAccessorResult)
552 .SetMethod("simulateWebNotificationClick", 555 .SetMethod("simulateWebNotificationClick",
553 &TestRunnerBindings::SimulateWebNotificationClick) 556 &TestRunnerBindings::SimulateWebNotificationClick)
554 .SetMethod("addMockSpeechRecognitionResult", 557 .SetMethod("addMockSpeechRecognitionResult",
555 &TestRunnerBindings::AddMockSpeechRecognitionResult) 558 &TestRunnerBindings::AddMockSpeechRecognitionResult)
556 .SetMethod("setMockSpeechRecognitionError", 559 .SetMethod("setMockSpeechRecognitionError",
557 &TestRunnerBindings::SetMockSpeechRecognitionError) 560 &TestRunnerBindings::SetMockSpeechRecognitionError)
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 return runner_->PathToLocalResource(path); 1343 return runner_->PathToLocalResource(path);
1341 return std::string(); 1344 return std::string();
1342 } 1345 }
1343 1346
1344 void TestRunnerBindings::SetBackingScaleFactor( 1347 void TestRunnerBindings::SetBackingScaleFactor(
1345 double value, v8::Local<v8::Function> callback) { 1348 double value, v8::Local<v8::Function> callback) {
1346 if (runner_) 1349 if (runner_)
1347 runner_->SetBackingScaleFactor(value, callback); 1350 runner_->SetBackingScaleFactor(value, callback);
1348 } 1351 }
1349 1352
1353 void TestRunnerBindings::EnableUseZoomForDSF(
1354 v8::Local<v8::Function> callback) {
1355 if (runner_)
1356 runner_->EnableUseZoomForDSF(callback);
1357 }
1358
1350 void TestRunnerBindings::SetColorProfile( 1359 void TestRunnerBindings::SetColorProfile(
1351 const std::string& name, v8::Local<v8::Function> callback) { 1360 const std::string& name, v8::Local<v8::Function> callback) {
1352 if (runner_) 1361 if (runner_)
1353 runner_->SetColorProfile(name, callback); 1362 runner_->SetColorProfile(name, callback);
1354 } 1363 }
1355 1364
1356 void TestRunnerBindings::SetBluetoothMockDataSet(const std::string& name) { 1365 void TestRunnerBindings::SetBluetoothMockDataSet(const std::string& name) {
1357 if (runner_) 1366 if (runner_)
1358 runner_->SetBluetoothMockDataSet(name); 1367 runner_->SetBluetoothMockDataSet(name);
1359 } 1368 }
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
2852 std::string TestRunner::PathToLocalResource(const std::string& path) { 2861 std::string TestRunner::PathToLocalResource(const std::string& path) {
2853 return delegate_->PathToLocalResource(path); 2862 return delegate_->PathToLocalResource(path);
2854 } 2863 }
2855 2864
2856 void TestRunner::SetBackingScaleFactor(double value, 2865 void TestRunner::SetBackingScaleFactor(double value,
2857 v8::Local<v8::Function> callback) { 2866 v8::Local<v8::Function> callback) {
2858 delegate_->SetDeviceScaleFactor(value); 2867 delegate_->SetDeviceScaleFactor(value);
2859 delegate_->PostTask(new InvokeCallbackTask(this, callback)); 2868 delegate_->PostTask(new InvokeCallbackTask(this, callback));
2860 } 2869 }
2861 2870
2871 void TestRunner::EnableUseZoomForDSF(v8::Local<v8::Function> callback) {
2872 delegate_->EnableUseZoomForDSF();
2873 delegate_->PostTask(new InvokeCallbackTask(this, callback));
2874 }
2875
2862 void TestRunner::SetColorProfile(const std::string& name, 2876 void TestRunner::SetColorProfile(const std::string& name,
2863 v8::Local<v8::Function> callback) { 2877 v8::Local<v8::Function> callback) {
2864 delegate_->SetDeviceColorProfile(name); 2878 delegate_->SetDeviceColorProfile(name);
2865 delegate_->PostTask(new InvokeCallbackTask(this, callback)); 2879 delegate_->PostTask(new InvokeCallbackTask(this, callback));
2866 } 2880 }
2867 2881
2868 void TestRunner::SetBluetoothMockDataSet(const std::string& name) { 2882 void TestRunner::SetBluetoothMockDataSet(const std::string& name) {
2869 delegate_->SetBluetoothMockDataSet(name); 2883 delegate_->SetBluetoothMockDataSet(name);
2870 } 2884 }
2871 2885
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
3162 } 3176 }
3163 3177
3164 void TestRunner::DidLosePointerLockInternal() { 3178 void TestRunner::DidLosePointerLockInternal() {
3165 bool was_locked = pointer_locked_; 3179 bool was_locked = pointer_locked_;
3166 pointer_locked_ = false; 3180 pointer_locked_ = false;
3167 if (was_locked) 3181 if (was_locked)
3168 web_view_->didLosePointerLock(); 3182 web_view_->didLosePointerLock();
3169 } 3183 }
3170 3184
3171 } // namespace test_runner 3185 } // namespace test_runner
OLDNEW
« no previous file with comments | « components/test_runner/test_runner.h ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698