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

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: Added new function setValidationMessageDirection, to avoid replicate code in web_test_proxy 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
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/i18n/rtl.h"
12 #include "base/logging.h" 13 #include "base/logging.h"
13 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "base/strings/utf_string_conversions.h"
14 #include "content/public/common/content_switches.h" 16 #include "content/public/common/content_switches.h"
15 #include "content/shell/renderer/test_runner/TestPlugin.h" 17 #include "content/shell/renderer/test_runner/TestPlugin.h"
16 #include "content/shell/renderer/test_runner/WebTestDelegate.h" 18 #include "content/shell/renderer/test_runner/WebTestDelegate.h"
17 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" 19 #include "content/shell/renderer/test_runner/WebTestInterfaces.h"
18 #include "content/shell/renderer/test_runner/accessibility_controller.h" 20 #include "content/shell/renderer/test_runner/accessibility_controller.h"
19 #include "content/shell/renderer/test_runner/event_sender.h" 21 #include "content/shell/renderer/test_runner/event_sender.h"
20 #include "content/shell/renderer/test_runner/mock_color_chooser.h" 22 #include "content/shell/renderer/test_runner/mock_color_chooser.h"
21 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" 23 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h"
22 #include "content/shell/renderer/test_runner/mock_web_push_client.h" 24 #include "content/shell/renderer/test_runner/mock_web_push_client.h"
23 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" 25 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 373
372 bool WebTestProxyBase::RunFileChooser( 374 bool WebTestProxyBase::RunFileChooser(
373 const blink::WebFileChooserParams& params, 375 const blink::WebFileChooserParams& params,
374 blink::WebFileChooserCompletion* completion) { 376 blink::WebFileChooserCompletion* completion) {
375 delegate_->printMessage("Mock: Opening a file chooser.\n"); 377 delegate_->printMessage("Mock: Opening a file chooser.\n");
376 // FIXME: Add ability to set file names to a file upload control. 378 // FIXME: Add ability to set file names to a file upload control.
377 return false; 379 return false;
378 } 380 }
379 381
380 void WebTestProxyBase::ShowValidationMessage( 382 void WebTestProxyBase::ShowValidationMessage(
381 const blink::WebRect& anchor_in_root_view, 383 const base::string16& message,
382 const blink::WebString& message, 384 const base::string16& sub_message) {
383 const blink::WebString& sub_message,
384 blink::WebTextDirection hint) {
385 delegate_->printMessage( 385 delegate_->printMessage(
386 std::string("ValidationMessageClient: main-message=") + 386 "ValidationMessageClient: main-message=" +
387 std::string(message.utf8()) + " sub-message=" + 387 base::UTF16ToUTF8(message) +
388 std::string(sub_message.utf8()) + "\n"); 388 " sub-message=" +
389 base::UTF16ToUTF8(sub_message) + "\n");
389 } 390 }
390 391
391 std::string WebTestProxyBase::CaptureTree(bool debug_render_tree) { 392 std::string WebTestProxyBase::CaptureTree(bool debug_render_tree) {
392 bool should_dump_custom_text = 393 bool should_dump_custom_text =
393 test_interfaces_->GetTestRunner()->shouldDumpAsCustomText(); 394 test_interfaces_->GetTestRunner()->shouldDumpAsCustomText();
394 bool should_dump_as_text = 395 bool should_dump_as_text =
395 test_interfaces_->GetTestRunner()->shouldDumpAsText(); 396 test_interfaces_->GetTestRunner()->shouldDumpAsText();
396 bool should_dump_as_markup = 397 bool should_dump_as_markup =
397 test_interfaces_->GetTestRunner()->shouldDumpAsMarkup(); 398 test_interfaces_->GetTestRunner()->shouldDumpAsMarkup();
398 bool should_dump_as_printed = test_interfaces_->GetTestRunner()->isPrinting(); 399 bool should_dump_as_printed = test_interfaces_->GetTestRunner()->isPrinting();
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 if (!push_client_.get()) 1261 if (!push_client_.get())
1261 push_client_.reset(new MockWebPushClient); 1262 push_client_.reset(new MockWebPushClient);
1262 return push_client_.get(); 1263 return push_client_.get();
1263 } 1264 }
1264 1265
1265 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { 1266 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() {
1266 return GetPushClientMock(); 1267 return GetPushClientMock();
1267 } 1268 }
1268 1269
1269 } // namespace content 1270 } // namespace content
OLDNEW
« content/renderer/render_view_impl.h ('K') | « 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