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

Side by Side Diff: chrome/test/webdriver/webdriver_session.cc

Issue 11359217: Move scoped_temp_dir from base to base/files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/webdriver/webdriver_session.h ('k') | chrome/test/webdriver/webdriver_util.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/webdriver_session.h" 5 #include "chrome/test/webdriver/webdriver_session.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after
1832 *location = temp_location; 1832 *location = temp_location;
1833 return NULL; 1833 return NULL;
1834 } 1834 }
1835 1835
1836 Error* Session::GetScreenShot(std::string* png) { 1836 Error* Session::GetScreenShot(std::string* png) {
1837 if (!current_target_.view_id.IsTab()) { 1837 if (!current_target_.view_id.IsTab()) {
1838 return new Error(kUnknownError, 1838 return new Error(kUnknownError,
1839 "The current target does not support screenshot"); 1839 "The current target does not support screenshot");
1840 } 1840 }
1841 Error* error = NULL; 1841 Error* error = NULL;
1842 ScopedTempDir screenshots_dir; 1842 base::ScopedTempDir screenshots_dir;
1843 if (!screenshots_dir.CreateUniqueTempDir()) { 1843 if (!screenshots_dir.CreateUniqueTempDir()) {
1844 return new Error(kUnknownError, 1844 return new Error(kUnknownError,
1845 "Could not create temp directory for screenshot"); 1845 "Could not create temp directory for screenshot");
1846 } 1846 }
1847 1847
1848 FilePath path = screenshots_dir.path().AppendASCII("screen"); 1848 FilePath path = screenshots_dir.path().AppendASCII("screen");
1849 RunSessionTask(base::Bind( 1849 RunSessionTask(base::Bind(
1850 &Automation::CaptureEntirePageAsPNG, 1850 &Automation::CaptureEntirePageAsPNG,
1851 base::Unretained(automation_.get()), 1851 base::Unretained(automation_.get()),
1852 current_target_.view_id, 1852 current_target_.view_id,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
1952 capabilities_.local_state->GetWithoutPathExpansion(*iter, &value); 1952 capabilities_.local_state->GetWithoutPathExpansion(*iter, &value);
1953 Error* error = SetPreference(*iter, false /* is_user_pref */, 1953 Error* error = SetPreference(*iter, false /* is_user_pref */,
1954 value->DeepCopy()); 1954 value->DeepCopy());
1955 if (error) 1955 if (error)
1956 return error; 1956 return error;
1957 } 1957 }
1958 return NULL; 1958 return NULL;
1959 } 1959 }
1960 1960
1961 } // namespace webdriver 1961 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/webdriver_session.h ('k') | chrome/test/webdriver/webdriver_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698