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

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

Issue 10854026: Added webdriver support for App v2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a comment. Created 8 years, 4 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
« no previous file with comments | « chrome/common/automation_id.h ('k') | chrome/test/webdriver/test/app_shell_extension/bg.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/webdriver/commands/target_locator_commands.h" 5 #include "chrome/test/webdriver/commands/target_locator_commands.h"
6 6
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/test/webdriver/commands/response.h" 9 #include "chrome/test/webdriver/commands/response.h"
10 #include "chrome/test/webdriver/webdriver_element_id.h" 10 #include "chrome/test/webdriver/webdriver_element_id.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 void WindowHandlesCommand::ExecuteGet(Response* const response) { 46 void WindowHandlesCommand::ExecuteGet(Response* const response) {
47 std::vector<WebViewInfo> views; 47 std::vector<WebViewInfo> views;
48 Error* error = session_->GetViews(&views); 48 Error* error = session_->GetViews(&views);
49 if (error) { 49 if (error) {
50 response->SetError(error); 50 response->SetError(error);
51 return; 51 return;
52 } 52 }
53 base::ListValue* id_list = new base::ListValue(); 53 base::ListValue* id_list = new base::ListValue();
54 for (size_t i = 0; i < views.size(); ++i) { 54 for (size_t i = 0; i < views.size(); ++i) {
55 if (!views[i].view_id.IsTab()) 55 if (!views[i].view_id.IsTab() &&
56 views[i].view_id.GetId().type() != AutomationId::kTypeAppShell)
56 continue; 57 continue;
57 id_list->Append(Value::CreateStringValue( 58 id_list->Append(Value::CreateStringValue(
58 WebViewIdToString(views[i].view_id))); 59 WebViewIdToString(views[i].view_id)));
59 } 60 }
60 response->SetValue(id_list); 61 response->SetValue(id_list);
61 } 62 }
62 63
63 WindowCommand::WindowCommand( 64 WindowCommand::WindowCommand(
64 const std::vector<std::string>& path_segments, 65 const std::vector<std::string>& path_segments,
65 DictionaryValue* parameters) 66 DictionaryValue* parameters)
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 Error* error = session_->ExecuteScript( 163 Error* error = session_->ExecuteScript(
163 "return document.activeElement || document.body", &args, &result); 164 "return document.activeElement || document.body", &args, &result);
164 if (error) { 165 if (error) {
165 response->SetError(error); 166 response->SetError(error);
166 return; 167 return;
167 } 168 }
168 response->SetValue(result); 169 response->SetValue(result);
169 } 170 }
170 171
171 } // namespace webdriver 172 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/common/automation_id.h ('k') | chrome/test/webdriver/test/app_shell_extension/bg.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698