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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 ®ion_offset); | 935 ®ion_offset); |
936 if (error) | 936 if (error) |
937 return error; | 937 return error; |
938 | 938 |
939 for (FramePath frame_path = current_target_.frame_path; | 939 for (FramePath frame_path = current_target_.frame_path; |
940 frame_path.IsSubframe(); | 940 frame_path.IsSubframe(); |
941 frame_path = frame_path.Parent()) { | 941 frame_path = frame_path.Parent()) { |
942 // Find the frame element for the current frame path. | 942 // Find the frame element for the current frame path. |
943 FrameId frame_id(current_target_.view_id, frame_path.Parent()); | 943 FrameId frame_id(current_target_.view_id, frame_path.Parent()); |
944 ElementId frame_element; | 944 ElementId frame_element; |
945 error = FindElement( | 945 error = FindElement(frame_id, |
946 frame_id, ElementId(""), | 946 ElementId(std::string()), |
947 LocatorType::kXpath, frame_path.BaseName().value(), &frame_element); | 947 LocatorType::kXpath, |
| 948 frame_path.BaseName().value(), |
| 949 &frame_element); |
948 if (error) { | 950 if (error) { |
949 std::string context = base::StringPrintf( | 951 std::string context = base::StringPrintf( |
950 "Could not find frame element (%s) in frame (%s)", | 952 "Could not find frame element (%s) in frame (%s)", |
951 frame_path.BaseName().value().c_str(), | 953 frame_path.BaseName().value().c_str(), |
952 frame_path.Parent().value().c_str()); | 954 frame_path.Parent().value().c_str()); |
953 error->AddDetails(context); | 955 error->AddDetails(context); |
954 return error; | 956 return error; |
955 } | 957 } |
956 // Modify |region_offset| by the frame's border. | 958 // Modify |region_offset| by the frame's border. |
957 int border_left, border_top; | 959 int border_left, border_top; |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1936 !iter.IsAtEnd(); iter.Advance()) { | 1938 !iter.IsAtEnd(); iter.Advance()) { |
1937 Error* error = SetPreference(iter.key(), false /* is_user_pref */, | 1939 Error* error = SetPreference(iter.key(), false /* is_user_pref */, |
1938 iter.value().DeepCopy()); | 1940 iter.value().DeepCopy()); |
1939 if (error) | 1941 if (error) |
1940 return error; | 1942 return error; |
1941 } | 1943 } |
1942 return NULL; | 1944 return NULL; |
1943 } | 1945 } |
1944 | 1946 |
1945 } // namespace webdriver | 1947 } // namespace webdriver |
OLD | NEW |