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

Side by Side Diff: chrome/test/webdriver/commands/create_session.cc

Issue 8890026: Allow chromedriver to set local state preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/webdriver/commands/create_session.h" 5 #include "chrome/test/webdriver/commands/create_session.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 // Since logging is shared among sessions, if any session requests verbose 51 // Since logging is shared among sessions, if any session requests verbose
52 // logging, verbose logging will be enabled for all sessions. It is not 52 // logging, verbose logging will be enabled for all sessions. It is not
53 // possible to turn it off. 53 // possible to turn it off.
54 if (caps.verbose) 54 if (caps.verbose)
55 logging::SetMinLogLevel(logging::LOG_INFO); 55 logging::SetMinLogLevel(logging::LOG_INFO);
56 56
57 Session::Options session_options; 57 Session::Options session_options;
58 session_options.load_async = caps.load_async; 58 session_options.load_async = caps.load_async;
59 session_options.use_native_events = caps.native_events; 59 session_options.use_native_events = caps.native_events;
60 session_options.no_website_testing_defaults =
61 caps.no_website_testing_defaults;
60 62
61 Automation::BrowserOptions browser_options; 63 Automation::BrowserOptions browser_options;
62 browser_options.command = caps.command; 64 browser_options.command = caps.command;
63 browser_options.channel_id = caps.channel; 65 browser_options.channel_id = caps.channel;
64 browser_options.detach_process = caps.detach; 66 browser_options.detach_process = caps.detach;
65 browser_options.user_data_dir = caps.profile; 67 browser_options.user_data_dir = caps.profile;
68 browser_options.cert_revocation_checking = caps.cert_revocation_checking;
66 69
67 // Session manages its own liftime, so do not call delete. 70 // Session manages its own liftime, so do not call delete.
68 Session* session = new Session(session_options); 71 Session* session = new Session(session_options);
69 error = session->Init(browser_options); 72 error = session->Init(browser_options);
70 if (error) { 73 if (error) {
71 response->SetError(error); 74 response->SetError(error);
72 return; 75 return;
73 } 76 }
74 77
75 // Install extensions.
76 for (size_t i = 0; i < caps.extensions.size(); ++i) {
77 Error* error = session->InstallExtensionDeprecated(caps.extensions[i]);
78 if (error) {
79 response->SetError(error);
80 return;
81 }
82 }
83
84 LOG(INFO) << "Created session " << session->id(); 78 LOG(INFO) << "Created session " << session->id();
85 // Redirect to a relative URI. Although prohibited by the HTTP standard, 79 // Redirect to a relative URI. Although prohibited by the HTTP standard,
86 // this is what the IEDriver does. Finding the actual IP address is 80 // this is what the IEDriver does. Finding the actual IP address is
87 // difficult, and returning the hostname causes perf problems with the python 81 // difficult, and returning the hostname causes perf problems with the python
88 // bindings on Windows. 82 // bindings on Windows.
89 std::ostringstream stream; 83 std::ostringstream stream;
90 stream << SessionManager::GetInstance()->url_base() << "/session/" 84 stream << SessionManager::GetInstance()->url_base() << "/session/"
91 << session->id(); 85 << session->id();
92 response->SetStatus(kSeeOther); 86 response->SetStatus(kSeeOther);
93 response->SetValue(Value::CreateStringValue(stream.str())); 87 response->SetValue(Value::CreateStringValue(stream.str()));
94 } 88 }
95 89
96 } // namespace webdriver 90 } // namespace webdriver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698