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

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

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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/ppapi/ppapi_test.cc ('k') | chrome/test/webdriver/webdriver_automation.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) 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/webelement_commands.h" 5 #include "chrome/test/webdriver/commands/webelement_commands.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 bool multiple = false; 554 bool multiple = false;
555 Error* error = HasAttributeWithLowerCaseValueASCII("multiple", "true", 555 Error* error = HasAttributeWithLowerCaseValueASCII("multiple", "true",
556 &multiple); 556 &multiple);
557 if (error) 557 if (error)
558 return error; 558 return error;
559 if (!multiple && paths.size() > 1) 559 if (!multiple && paths.size() > 1)
560 return new Error(kBadRequest, "The element can not hold multiple files"); 560 return new Error(kBadRequest, "The element can not hold multiple files");
561 561
562 // Check the files exist. 562 // Check the files exist.
563 for (size_t i = 0; i < paths.size(); ++i) { 563 for (size_t i = 0; i < paths.size(); ++i) {
564 if (!file_util::PathExists(base::FilePath(paths[i]))) { 564 if (!base::PathExists(base::FilePath(paths[i]))) {
565 return new Error( 565 return new Error(
566 kBadRequest, 566 kBadRequest,
567 base::StringPrintf("'%s' does not exist on the file system", 567 base::StringPrintf("'%s' does not exist on the file system",
568 UTF16ToUTF8( 568 UTF16ToUTF8(
569 base::FilePath(paths[i]).LossyDisplayName()).c_str())); 569 base::FilePath(paths[i]).LossyDisplayName()).c_str()));
570 } 570 }
571 } 571 }
572 572
573 Point location; 573 Point location;
574 error = session_->GetClickableLocation(element, &location); 574 error = session_->GetClickableLocation(element, &location);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 return; 623 return;
624 } 624 }
625 if (!result->IsType(base::Value::TYPE_STRING)) { 625 if (!result->IsType(base::Value::TYPE_STRING)) {
626 response->SetError(new Error(kUnknownError, "Result is not string type")); 626 response->SetError(new Error(kUnknownError, "Result is not string type"));
627 return; 627 return;
628 } 628 }
629 response->SetValue(result.release()); 629 response->SetValue(result.release());
630 } 630 }
631 631
632 } // namespace webdriver 632 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/ppapi/ppapi_test.cc ('k') | chrome/test/webdriver/webdriver_automation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698