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

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

Issue 1422673002: Extract Notifications kClickWasNotAnAction constant Base URL: https://chromium.googlesource.com/chromium/src.git@actions_spec_sync
Patch Set: Created 5 years, 2 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 "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 "build/build_config.h" 10 #include "build/build_config.h"
11 #include "components/test_runner/mock_credential_manager_client.h" 11 #include "components/test_runner/mock_credential_manager_client.h"
12 #include "components/test_runner/mock_web_speech_recognizer.h" 12 #include "components/test_runner/mock_web_speech_recognizer.h"
13 #include "components/test_runner/test_interfaces.h" 13 #include "components/test_runner/test_interfaces.h"
14 #include "components/test_runner/test_preferences.h" 14 #include "components/test_runner/test_preferences.h"
15 #include "components/test_runner/web_content_settings.h" 15 #include "components/test_runner/web_content_settings.h"
16 #include "components/test_runner/web_test_delegate.h" 16 #include "components/test_runner/web_test_delegate.h"
17 #include "components/test_runner/web_test_proxy.h" 17 #include "components/test_runner/web_test_proxy.h"
18 #include "content/public/common/platform_notification_data.h"
18 #include "gin/arguments.h" 19 #include "gin/arguments.h"
19 #include "gin/array_buffer.h" 20 #include "gin/array_buffer.h"
20 #include "gin/handle.h" 21 #include "gin/handle.h"
21 #include "gin/object_template_builder.h" 22 #include "gin/object_template_builder.h"
22 #include "gin/wrappable.h" 23 #include "gin/wrappable.h"
23 #include "third_party/WebKit/public/platform/WebBatteryStatus.h" 24 #include "third_party/WebKit/public/platform/WebBatteryStatus.h"
24 #include "third_party/WebKit/public/platform/WebCanvas.h" 25 #include "third_party/WebKit/public/platform/WebCanvas.h"
25 #include "third_party/WebKit/public/platform/WebData.h" 26 #include "third_party/WebKit/public/platform/WebData.h"
26 #include "third_party/WebKit/public/platform/WebPasswordCredential.h" 27 #include "third_party/WebKit/public/platform/WebPasswordCredential.h"
27 #include "third_party/WebKit/public/platform/WebPoint.h" 28 #include "third_party/WebKit/public/platform/WebPoint.h"
(...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 1383
1383 void TestRunnerBindings::SetMIDIAccessorResult(bool result) { 1384 void TestRunnerBindings::SetMIDIAccessorResult(bool result) {
1384 if (runner_) 1385 if (runner_)
1385 runner_->SetMIDIAccessorResult(result); 1386 runner_->SetMIDIAccessorResult(result);
1386 } 1387 }
1387 1388
1388 void TestRunnerBindings::SimulateWebNotificationClick(gin::Arguments* args) { 1389 void TestRunnerBindings::SimulateWebNotificationClick(gin::Arguments* args) {
1389 if (!runner_) 1390 if (!runner_)
1390 return; 1391 return;
1391 std::string title; 1392 std::string title;
1392 int action_index = -1; 1393 int action_index = content::kNotificationClickWasNotAnAction;
1393 if (args->GetNext(&title) && 1394 if (args->GetNext(&title) &&
1394 (args->PeekNext().IsEmpty() || args->GetNext(&action_index))) 1395 (args->PeekNext().IsEmpty() || args->GetNext(&action_index)))
1395 runner_->SimulateWebNotificationClick(title, action_index); 1396 runner_->SimulateWebNotificationClick(title, action_index);
1396 else 1397 else
1397 args->ThrowError(); 1398 args->ThrowError();
1398 } 1399 }
1399 1400
1400 void TestRunnerBindings::AddMockSpeechRecognitionResult( 1401 void TestRunnerBindings::AddMockSpeechRecognitionResult(
1401 const std::string& transcript, double confidence) { 1402 const std::string& transcript, double confidence) {
1402 if (runner_) 1403 if (runner_)
(...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after
3152 } 3153 }
3153 3154
3154 void TestRunner::DidLosePointerLockInternal() { 3155 void TestRunner::DidLosePointerLockInternal() {
3155 bool was_locked = pointer_locked_; 3156 bool was_locked = pointer_locked_;
3156 pointer_locked_ = false; 3157 pointer_locked_ = false;
3157 if (was_locked) 3158 if (was_locked)
3158 web_view_->didLosePointerLock(); 3159 web_view_->didLosePointerLock();
3159 } 3160 }
3160 3161
3161 } // namespace test_runner 3162 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698