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

Side by Side Diff: chrome/test/chromedriver/element_util.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromedriver/element_util.h" 5 #include "chrome/test/chromedriver/element_util.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 arguments.Append(CreateElement(*root_element_id)); 257 arguments.Append(CreateElement(*root_element_id));
258 258
259 base::TimeTicks start_time = base::TimeTicks::Now(); 259 base::TimeTicks start_time = base::TimeTicks::Now();
260 while (true) { 260 while (true) {
261 std::unique_ptr<base::Value> temp; 261 std::unique_ptr<base::Value> temp;
262 Status status = web_view->CallFunction( 262 Status status = web_view->CallFunction(
263 session->GetCurrentFrameId(), script, arguments, &temp); 263 session->GetCurrentFrameId(), script, arguments, &temp);
264 if (status.IsError()) 264 if (status.IsError())
265 return status; 265 return status;
266 266
267 if (!temp->IsType(base::Value::TYPE_NULL)) { 267 if (!temp->IsType(base::Value::Type::NONE)) {
268 if (only_one) { 268 if (only_one) {
269 value->reset(temp.release()); 269 value->reset(temp.release());
270 return Status(kOk); 270 return Status(kOk);
271 } else { 271 } else {
272 base::ListValue* result; 272 base::ListValue* result;
273 if (!temp->GetAsList(&result)) 273 if (!temp->GetAsList(&result))
274 return Status(kUnknownError, "script returns unexpected result"); 274 return Status(kUnknownError, "script returns unexpected result");
275 if (result->GetSize() > 0U) { 275 if (result->GetSize() > 0U) {
276 value->reset(temp.release()); 276 value->reset(temp.release());
277 return Status(kOk); 277 return Status(kOk);
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 status = ScrollElementRegionIntoViewHelper( 655 status = ScrollElementRegionIntoViewHelper(
656 rit->parent_frame_id, web_view, frame_element_id, 656 rit->parent_frame_id, web_view, frame_element_id,
657 WebRect(region_offset, region_size), 657 WebRect(region_offset, region_size),
658 center, frame_element_id, &region_offset); 658 center, frame_element_id, &region_offset);
659 if (status.IsError()) 659 if (status.IsError())
660 return status; 660 return status;
661 } 661 }
662 *location = region_offset; 662 *location = region_offset;
663 return Status(kOk); 663 return Status(kOk);
664 } 664 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/chrome/web_view_impl_unittest.cc ('k') | chrome/test/chromedriver/window_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698