OLD | NEW |
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 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1837 | 1837 |
1838 base::FilePath path = screenshots_dir.path().AppendASCII("screen"); | 1838 base::FilePath path = screenshots_dir.path().AppendASCII("screen"); |
1839 RunSessionTask(base::Bind( | 1839 RunSessionTask(base::Bind( |
1840 &Automation::CaptureEntirePageAsPNG, | 1840 &Automation::CaptureEntirePageAsPNG, |
1841 base::Unretained(automation_.get()), | 1841 base::Unretained(automation_.get()), |
1842 current_target_.view_id, | 1842 current_target_.view_id, |
1843 path, | 1843 path, |
1844 &error)); | 1844 &error)); |
1845 if (error) | 1845 if (error) |
1846 return error; | 1846 return error; |
1847 if (!file_util::ReadFileToString(path, png)) | 1847 if (!base::ReadFileToString(path, png)) |
1848 return new Error(kUnknownError, "Could not read screenshot file"); | 1848 return new Error(kUnknownError, "Could not read screenshot file"); |
1849 return NULL; | 1849 return NULL; |
1850 } | 1850 } |
1851 | 1851 |
1852 #if !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) | 1852 #if !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) |
1853 Error* Session::HeapProfilerDump(const std::string& reason) { | 1853 Error* Session::HeapProfilerDump(const std::string& reason) { |
1854 // TODO(dmikurube): Support browser processes. | 1854 // TODO(dmikurube): Support browser processes. |
1855 Error* error = NULL; | 1855 Error* error = NULL; |
1856 RunSessionTask(base::Bind( | 1856 RunSessionTask(base::Bind( |
1857 &Automation::HeapProfilerDump, | 1857 &Automation::HeapProfilerDump, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1938 !iter.IsAtEnd(); iter.Advance()) { | 1938 !iter.IsAtEnd(); iter.Advance()) { |
1939 Error* error = SetPreference(iter.key(), false /* is_user_pref */, | 1939 Error* error = SetPreference(iter.key(), false /* is_user_pref */, |
1940 iter.value().DeepCopy()); | 1940 iter.value().DeepCopy()); |
1941 if (error) | 1941 if (error) |
1942 return error; | 1942 return error; |
1943 } | 1943 } |
1944 return NULL; | 1944 return NULL; |
1945 } | 1945 } |
1946 | 1946 |
1947 } // namespace webdriver | 1947 } // namespace webdriver |
OLD | NEW |