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

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

Issue 391923006: Extra parameter to pass sub-message direction for validation message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated to latest master Created 6 years, 3 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 | « content/shell/renderer/test_runner/web_test_proxy.h ('k') | 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 "content/shell/renderer/test_runner/web_test_proxy.h" 5 #include "content/shell/renderer/test_runner/web_test_proxy.h"
6 6
7 #include <cctype> 7 #include <cctype>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/debug/trace_event.h" 11 #include "base/debug/trace_event.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "base/strings/utf_string_conversions.h"
15 #include "content/public/common/content_switches.h" 16 #include "content/public/common/content_switches.h"
16 #include "content/shell/renderer/test_runner/WebTestDelegate.h" 17 #include "content/shell/renderer/test_runner/WebTestDelegate.h"
17 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" 18 #include "content/shell/renderer/test_runner/WebTestInterfaces.h"
18 #include "content/shell/renderer/test_runner/accessibility_controller.h" 19 #include "content/shell/renderer/test_runner/accessibility_controller.h"
19 #include "content/shell/renderer/test_runner/event_sender.h" 20 #include "content/shell/renderer/test_runner/event_sender.h"
20 #include "content/shell/renderer/test_runner/mock_color_chooser.h" 21 #include "content/shell/renderer/test_runner/mock_color_chooser.h"
21 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" 22 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h"
22 #include "content/shell/renderer/test_runner/mock_web_push_client.h" 23 #include "content/shell/renderer/test_runner/mock_web_push_client.h"
23 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" 24 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h"
24 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" 25 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 377
377 bool WebTestProxyBase::RunFileChooser( 378 bool WebTestProxyBase::RunFileChooser(
378 const blink::WebFileChooserParams& params, 379 const blink::WebFileChooserParams& params,
379 blink::WebFileChooserCompletion* completion) { 380 blink::WebFileChooserCompletion* completion) {
380 delegate_->printMessage("Mock: Opening a file chooser.\n"); 381 delegate_->printMessage("Mock: Opening a file chooser.\n");
381 // FIXME: Add ability to set file names to a file upload control. 382 // FIXME: Add ability to set file names to a file upload control.
382 return false; 383 return false;
383 } 384 }
384 385
385 void WebTestProxyBase::ShowValidationMessage( 386 void WebTestProxyBase::ShowValidationMessage(
386 const blink::WebRect& anchor_in_root_view, 387 const base::string16& message,
387 const blink::WebString& message, 388 const base::string16& sub_message) {
388 const blink::WebString& sub_message,
389 blink::WebTextDirection hint) {
390 delegate_->printMessage( 389 delegate_->printMessage(
391 std::string("ValidationMessageClient: main-message=") + 390 "ValidationMessageClient: main-message=" +
392 std::string(message.utf8()) + " sub-message=" + 391 base::UTF16ToUTF8(message) +
393 std::string(sub_message.utf8()) + "\n"); 392 " sub-message=" +
393 base::UTF16ToUTF8(sub_message) + "\n");
394 } 394 }
395 395
396 std::string WebTestProxyBase::CaptureTree(bool debug_render_tree) { 396 std::string WebTestProxyBase::CaptureTree(bool debug_render_tree) {
397 bool should_dump_custom_text = 397 bool should_dump_custom_text =
398 test_interfaces_->GetTestRunner()->shouldDumpAsCustomText(); 398 test_interfaces_->GetTestRunner()->shouldDumpAsCustomText();
399 bool should_dump_as_text = 399 bool should_dump_as_text =
400 test_interfaces_->GetTestRunner()->shouldDumpAsText(); 400 test_interfaces_->GetTestRunner()->shouldDumpAsText();
401 bool should_dump_as_markup = 401 bool should_dump_as_markup =
402 test_interfaces_->GetTestRunner()->shouldDumpAsMarkup(); 402 test_interfaces_->GetTestRunner()->shouldDumpAsMarkup();
403 bool should_dump_as_printed = test_interfaces_->GetTestRunner()->isPrinting(); 403 bool should_dump_as_printed = test_interfaces_->GetTestRunner()->isPrinting();
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 if (!push_client_.get()) 1265 if (!push_client_.get())
1266 push_client_.reset(new MockWebPushClient); 1266 push_client_.reset(new MockWebPushClient);
1267 return push_client_.get(); 1267 return push_client_.get();
1268 } 1268 }
1269 1269
1270 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { 1270 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() {
1271 return GetPushClientMock(); 1271 return GetPushClientMock();
1272 } 1272 }
1273 1273
1274 } // namespace content 1274 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/web_test_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698