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

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

Issue 6630001: Allow webdriver users to choose between sending the key events when... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 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) 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 <sstream> 7 #include <sstream>
8 #include <string> 8 #include <string>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 19 matching lines...) Expand all
30 30
31 // Session manages its own liftime, so do not call delete. 31 // Session manages its own liftime, so do not call delete.
32 Session* session = new Session(); 32 Session* session = new Session();
33 if (!session->Init(session_manager->chrome_dir())) { 33 if (!session->Init(session_manager->chrome_dir())) {
34 SET_WEBDRIVER_ERROR(response, 34 SET_WEBDRIVER_ERROR(response,
35 "Failed to initialize session", 35 "Failed to initialize session",
36 kInternalServerError); 36 kInternalServerError);
37 return; 37 return;
38 } 38 }
39 39
40 DictionaryValue* capabilities = NULL;
41 bool native_events_required = false;
42 if (GetDictionaryParameter("desiredCapabilities", &capabilities)) {
43 capabilities->GetBoolean("chrome.nativeEvents", &native_events_required);
44 session->set_use_native_events(native_events_required);
45 }
46
40 bool screenshot_on_error = false; 47 bool screenshot_on_error = false;
41 DictionaryValue* capabilities = NULL;
42 if (GetDictionaryParameter("desiredCapabilities", &capabilities)) { 48 if (GetDictionaryParameter("desiredCapabilities", &capabilities)) {
43 capabilities->GetBoolean("takeScreenshotOnError", &screenshot_on_error); 49 capabilities->GetBoolean("takeScreenshotOnError", &screenshot_on_error);
44 session->set_screenshot_on_error(screenshot_on_error); 50 session->set_screenshot_on_error(screenshot_on_error);
45 } 51 }
46 52
47 VLOG(1) << "Created session " << session->id(); 53 VLOG(1) << "Created session " << session->id();
48 std::ostringstream stream; 54 std::ostringstream stream;
49 stream << "http://" << session_manager->GetAddress() << "/session/" 55 stream << "http://" << session_manager->GetAddress() << "/session/"
50 << session->id(); 56 << session->id();
51 response->SetStatus(kSeeOther); 57 response->SetStatus(kSeeOther);
52 response->SetValue(Value::CreateStringValue(stream.str())); 58 response->SetValue(Value::CreateStringValue(stream.str()));
53 } 59 }
54 60
55 } // namespace webdriver 61 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/chromedriver_tests.py ('k') | chrome/test/webdriver/commands/session_with_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698