| 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 "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/public/test/layouttest_support.h" | 10 #include "content/public/test/layouttest_support.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 void ClearAllDatabases(); | 275 void ClearAllDatabases(); |
| 276 void SetDatabaseQuota(int quota); | 276 void SetDatabaseQuota(int quota); |
| 277 void SetAlwaysAcceptCookies(bool accept); | 277 void SetAlwaysAcceptCookies(bool accept); |
| 278 void SetWindowIsKey(bool value); | 278 void SetWindowIsKey(bool value); |
| 279 std::string PathToLocalResource(const std::string& path); | 279 std::string PathToLocalResource(const std::string& path); |
| 280 void SetBackingScaleFactor(double value, v8::Handle<v8::Function> callback); | 280 void SetBackingScaleFactor(double value, v8::Handle<v8::Function> callback); |
| 281 void SetColorProfile(const std::string& name, | 281 void SetColorProfile(const std::string& name, |
| 282 v8::Handle<v8::Function> callback); | 282 v8::Handle<v8::Function> callback); |
| 283 void SetPOSIXLocale(const std::string& locale); | 283 void SetPOSIXLocale(const std::string& locale); |
| 284 void SetMIDIAccessorResult(bool result); | 284 void SetMIDIAccessorResult(bool result); |
| 285 void GrantWebNotificationPermission(gin::Arguments* args); | |
| 286 void ClearWebNotificationPermissions(); | |
| 287 void SimulateWebNotificationClick(const std::string& title); | 285 void SimulateWebNotificationClick(const std::string& title); |
| 288 void AddMockSpeechRecognitionResult(const std::string& transcript, | 286 void AddMockSpeechRecognitionResult(const std::string& transcript, |
| 289 double confidence); | 287 double confidence); |
| 290 void SetMockSpeechRecognitionError(const std::string& error, | 288 void SetMockSpeechRecognitionError(const std::string& error, |
| 291 const std::string& message); | 289 const std::string& message); |
| 292 bool WasMockSpeechRecognitionAborted(); | 290 bool WasMockSpeechRecognitionAborted(); |
| 293 void AddMockCredentialManagerResponse(const std::string& id, | 291 void AddMockCredentialManagerResponse(const std::string& id, |
| 294 const std::string& name, | 292 const std::string& name, |
| 295 const std::string& avatar, | 293 const std::string& avatar, |
| 296 const std::string& password); | 294 const std::string& password); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 &TestRunnerBindings::SetAlwaysAcceptCookies) | 519 &TestRunnerBindings::SetAlwaysAcceptCookies) |
| 522 .SetMethod("setWindowIsKey", &TestRunnerBindings::SetWindowIsKey) | 520 .SetMethod("setWindowIsKey", &TestRunnerBindings::SetWindowIsKey) |
| 523 .SetMethod("pathToLocalResource", | 521 .SetMethod("pathToLocalResource", |
| 524 &TestRunnerBindings::PathToLocalResource) | 522 &TestRunnerBindings::PathToLocalResource) |
| 525 .SetMethod("setBackingScaleFactor", | 523 .SetMethod("setBackingScaleFactor", |
| 526 &TestRunnerBindings::SetBackingScaleFactor) | 524 &TestRunnerBindings::SetBackingScaleFactor) |
| 527 .SetMethod("setColorProfile", &TestRunnerBindings::SetColorProfile) | 525 .SetMethod("setColorProfile", &TestRunnerBindings::SetColorProfile) |
| 528 .SetMethod("setPOSIXLocale", &TestRunnerBindings::SetPOSIXLocale) | 526 .SetMethod("setPOSIXLocale", &TestRunnerBindings::SetPOSIXLocale) |
| 529 .SetMethod("setMIDIAccessorResult", | 527 .SetMethod("setMIDIAccessorResult", |
| 530 &TestRunnerBindings::SetMIDIAccessorResult) | 528 &TestRunnerBindings::SetMIDIAccessorResult) |
| 531 .SetMethod("grantWebNotificationPermission", | |
| 532 &TestRunnerBindings::GrantWebNotificationPermission) | |
| 533 .SetMethod("clearWebNotificationPermissions", | |
| 534 &TestRunnerBindings::ClearWebNotificationPermissions) | |
| 535 .SetMethod("simulateWebNotificationClick", | 529 .SetMethod("simulateWebNotificationClick", |
| 536 &TestRunnerBindings::SimulateWebNotificationClick) | 530 &TestRunnerBindings::SimulateWebNotificationClick) |
| 537 .SetMethod("addMockSpeechRecognitionResult", | 531 .SetMethod("addMockSpeechRecognitionResult", |
| 538 &TestRunnerBindings::AddMockSpeechRecognitionResult) | 532 &TestRunnerBindings::AddMockSpeechRecognitionResult) |
| 539 .SetMethod("setMockSpeechRecognitionError", | 533 .SetMethod("setMockSpeechRecognitionError", |
| 540 &TestRunnerBindings::SetMockSpeechRecognitionError) | 534 &TestRunnerBindings::SetMockSpeechRecognitionError) |
| 541 .SetMethod("wasMockSpeechRecognitionAborted", | 535 .SetMethod("wasMockSpeechRecognitionAborted", |
| 542 &TestRunnerBindings::WasMockSpeechRecognitionAborted) | 536 &TestRunnerBindings::WasMockSpeechRecognitionAborted) |
| 543 .SetMethod("addMockCredentialManagerResponse", | 537 .SetMethod("addMockCredentialManagerResponse", |
| 544 &TestRunnerBindings::AddMockCredentialManagerResponse) | 538 &TestRunnerBindings::AddMockCredentialManagerResponse) |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1319 void TestRunnerBindings::SetPOSIXLocale(const std::string& locale) { | 1313 void TestRunnerBindings::SetPOSIXLocale(const std::string& locale) { |
| 1320 if (runner_) | 1314 if (runner_) |
| 1321 runner_->SetPOSIXLocale(locale); | 1315 runner_->SetPOSIXLocale(locale); |
| 1322 } | 1316 } |
| 1323 | 1317 |
| 1324 void TestRunnerBindings::SetMIDIAccessorResult(bool result) { | 1318 void TestRunnerBindings::SetMIDIAccessorResult(bool result) { |
| 1325 if (runner_) | 1319 if (runner_) |
| 1326 runner_->SetMIDIAccessorResult(result); | 1320 runner_->SetMIDIAccessorResult(result); |
| 1327 } | 1321 } |
| 1328 | 1322 |
| 1329 void TestRunnerBindings::GrantWebNotificationPermission(gin::Arguments* args) { | |
| 1330 } | |
| 1331 | |
| 1332 void TestRunnerBindings::ClearWebNotificationPermissions() { | |
| 1333 } | |
| 1334 | |
| 1335 void TestRunnerBindings::SimulateWebNotificationClick( | 1323 void TestRunnerBindings::SimulateWebNotificationClick( |
| 1336 const std::string& title) { | 1324 const std::string& title) { |
| 1337 if (runner_) | 1325 if (runner_) |
| 1338 runner_->SimulateWebNotificationClick(title); | 1326 runner_->SimulateWebNotificationClick(title); |
| 1339 } | 1327 } |
| 1340 | 1328 |
| 1341 void TestRunnerBindings::AddMockSpeechRecognitionResult( | 1329 void TestRunnerBindings::AddMockSpeechRecognitionResult( |
| 1342 const std::string& transcript, double confidence) { | 1330 const std::string& transcript, double confidence) { |
| 1343 if (runner_) | 1331 if (runner_) |
| 1344 runner_->AddMockSpeechRecognitionResult(transcript, confidence); | 1332 runner_->AddMockSpeechRecognitionResult(transcript, confidence); |
| (...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3007 } | 2995 } |
| 3008 | 2996 |
| 3009 void TestRunner::DidLosePointerLockInternal() { | 2997 void TestRunner::DidLosePointerLockInternal() { |
| 3010 bool was_locked = pointer_locked_; | 2998 bool was_locked = pointer_locked_; |
| 3011 pointer_locked_ = false; | 2999 pointer_locked_ = false; |
| 3012 if (was_locked) | 3000 if (was_locked) |
| 3013 web_view_->didLosePointerLock(); | 3001 web_view_->didLosePointerLock(); |
| 3014 } | 3002 } |
| 3015 | 3003 |
| 3016 } // namespace content | 3004 } // namespace content |
| OLD | NEW |