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

Side by Side Diff: chrome/test/base/ui_test_utils.cc

Issue 9959062: browser_tests to access wss:// after proceeds anyway (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add copyright to echo_wsh.py (copied from PRESUBMIT.py) Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/test/base/ui_test_utils.h" 5 #include "chrome/test/base/ui_test_utils.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 761
762 void TimedMessageLoopRunner::QuitAfter(int ms) { 762 void TimedMessageLoopRunner::QuitAfter(int ms) {
763 quit_loop_invoked_ = true; 763 quit_loop_invoked_ = true;
764 loop_->PostDelayedTask( 764 loop_->PostDelayedTask(
765 FROM_HERE, 765 FROM_HERE,
766 MessageLoop::QuitClosure(), 766 MessageLoop::QuitClosure(),
767 base::TimeDelta::FromMilliseconds(ms)); 767 base::TimeDelta::FromMilliseconds(ms));
768 } 768 }
769 769
770 TestWebSocketServer::TestWebSocketServer() 770 TestWebSocketServer::TestWebSocketServer()
771 : started_(false), port_(kDefaultWsPort) { 771 : started_(false),
772 port_(kDefaultWsPort),
773 secure_(false) {
772 #if defined(OS_POSIX) 774 #if defined(OS_POSIX)
773 process_group_id_ = base::kNullProcessHandle; 775 process_group_id_ = base::kNullProcessHandle;
774 #endif 776 #endif
775 } 777 }
776 778
777 int TestWebSocketServer::UseRandomPort() { 779 int TestWebSocketServer::UseRandomPort() {
778 port_ = base::RandInt(1024, 65535); 780 port_ = base::RandInt(1024, 65535);
779 return port_; 781 return port_;
780 } 782 }
781 783
784 void TestWebSocketServer::UseTLS() {
785 secure_ = true;
786 }
787
782 bool TestWebSocketServer::Start(const FilePath& root_directory) { 788 bool TestWebSocketServer::Start(const FilePath& root_directory) {
783 if (started_) 789 if (started_)
784 return true; 790 return true;
785 // Append CommandLine arguments after the server script, switches won't work. 791 // Append CommandLine arguments after the server script, switches won't work.
786 scoped_ptr<CommandLine> cmd_line(CreateWebSocketServerCommandLine()); 792 scoped_ptr<CommandLine> cmd_line(CreateWebSocketServerCommandLine());
787 cmd_line->AppendArg("--server=start"); 793 cmd_line->AppendArg("--server=start");
788 cmd_line->AppendArg("--chromium"); 794 cmd_line->AppendArg("--chromium");
789 cmd_line->AppendArg("--register_cygwin"); 795 cmd_line->AppendArg("--register_cygwin");
790 cmd_line->AppendArgNative(FILE_PATH_LITERAL("--root=") + 796 cmd_line->AppendArgNative(FILE_PATH_LITERAL("--root=") +
791 root_directory.value()); 797 root_directory.value());
792 cmd_line->AppendArg("--port=" + base::IntToString(port_)); 798 cmd_line->AppendArg("--port=" + base::IntToString(port_));
799 if (secure_)
800 cmd_line->AppendArg("--tls");
793 if (!temp_dir_.CreateUniqueTempDir()) { 801 if (!temp_dir_.CreateUniqueTempDir()) {
794 LOG(ERROR) << "Unable to create a temporary directory."; 802 LOG(ERROR) << "Unable to create a temporary directory.";
795 return false; 803 return false;
796 } 804 }
797 websocket_pid_file_ = temp_dir_.path().AppendASCII("websocket.pid"); 805 websocket_pid_file_ = temp_dir_.path().AppendASCII("websocket.pid");
798 cmd_line->AppendArgNative(FILE_PATH_LITERAL("--pidfile=") + 806 cmd_line->AppendArgNative(FILE_PATH_LITERAL("--pidfile=") +
799 websocket_pid_file_.value()); 807 websocket_pid_file_.value());
800 SetPythonPath(); 808 SetPythonPath();
801 809
802 base::LaunchOptions options; 810 base::LaunchOptions options;
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 int state, 1164 int state,
1157 const base::Closure& followup) { 1165 const base::Closure& followup) {
1158 if (!followup.is_null()) 1166 if (!followup.is_null())
1159 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); 1167 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup);
1160 else 1168 else
1161 ui_controls::SendMouseEvents(button, state); 1169 ui_controls::SendMouseEvents(button, state);
1162 } 1170 }
1163 1171
1164 } // namespace internal 1172 } // namespace internal
1165 } // namespace ui_test_utils 1173 } // namespace ui_test_utils
OLDNEW
« no previous file with comments | « chrome/test/base/ui_test_utils.h ('k') | chrome/test/data/http/tests/websocket/tests/echo_wsh.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698