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

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

Issue 6001010: Move platform_thread to base/threading and put in the base namespace. I left ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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/test/ui/ui_test.cc ('k') | chrome/test/webdriver/server.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/find_element_commands.h" 5 #include "chrome/test/webdriver/commands/find_element_commands.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 #include <string> 8 #include <string>
9 9
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
11 #include "base/threading/platform_thread.h"
11 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
12 #include "base/values.h" 13 #include "base/values.h"
13 #include "third_party/webdriver/atoms.h" 14 #include "third_party/webdriver/atoms.h"
14 #include "chrome/test/webdriver/error_codes.h" 15 #include "chrome/test/webdriver/error_codes.h"
15 #include "chrome/test/webdriver/utility_functions.h" 16 #include "chrome/test/webdriver/utility_functions.h"
16 17
17 namespace webdriver { 18 namespace webdriver {
18 19
19 bool FindElementCommand::Init(Response* const response) { 20 bool FindElementCommand::Init(Response* const response) {
20 if (!WebDriverCommand::Init(response)) { 21 if (!WebDriverCommand::Init(response)) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 (result->GetType() == Value::TYPE_LIST && 94 (result->GetType() == Value::TYPE_LIST &&
94 static_cast<ListValue*>(result)->GetSize() > 0); 95 static_cast<ListValue*>(result)->GetSize() > 0);
95 } else if (error != kNoSuchElement) { 96 } else if (error != kNoSuchElement) {
96 SET_WEBDRIVER_ERROR(response, "Internal error in find_element atom", 97 SET_WEBDRIVER_ERROR(response, "Internal error in find_element atom",
97 kInternalServerError); 98 kInternalServerError);
98 return; 99 return;
99 } 100 }
100 101
101 int64 elapsed_time = (base::Time::Now() - start_time).InMilliseconds(); 102 int64 elapsed_time = (base::Time::Now() - start_time).InMilliseconds();
102 done = done || elapsed_time > session_->implicit_wait(); 103 done = done || elapsed_time > session_->implicit_wait();
103 PlatformThread::Sleep(50); // Prevent a busy loop that eats the cpu. 104 base::PlatformThread::Sleep(50); // Prevent a busy loop that eats the cpu.
104 } 105 }
105 106
106 response->set_value(result); 107 response->set_value(result);
107 response->set_status(error); 108 response->set_status(error);
108 } 109 }
109 110
110 } // namespace webdriver 111 } // namespace webdriver
111 112
OLDNEW
« no previous file with comments | « chrome/test/ui/ui_test.cc ('k') | chrome/test/webdriver/server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698