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 "content/public/test/browser_test_utils.h" | 5 #include "content/public/test/browser_test_utils.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <tuple> | 8 #include <tuple> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 frame_set->insert(host); | 928 frame_set->insert(host); |
929 } | 929 } |
930 } | 930 } |
931 | 931 |
932 RenderFrameHost* FrameMatchingPredicate( | 932 RenderFrameHost* FrameMatchingPredicate( |
933 WebContents* web_contents, | 933 WebContents* web_contents, |
934 const base::Callback<bool(RenderFrameHost*)>& predicate) { | 934 const base::Callback<bool(RenderFrameHost*)>& predicate) { |
935 std::set<RenderFrameHost*> frame_set; | 935 std::set<RenderFrameHost*> frame_set; |
936 web_contents->ForEachFrame( | 936 web_contents->ForEachFrame( |
937 base::Bind(&AddToSetIfFrameMatchesPredicate, &frame_set, predicate)); | 937 base::Bind(&AddToSetIfFrameMatchesPredicate, &frame_set, predicate)); |
938 DCHECK_EQ(1U, frame_set.size()); | 938 EXPECT_EQ(1U, frame_set.size()); |
939 return *frame_set.begin(); | 939 return frame_set.size() == 1 ? *frame_set.begin() : nullptr; |
940 } | 940 } |
941 | 941 |
942 bool FrameMatchesName(const std::string& name, RenderFrameHost* frame) { | 942 bool FrameMatchesName(const std::string& name, RenderFrameHost* frame) { |
943 return frame->GetFrameName() == name; | 943 return frame->GetFrameName() == name; |
944 } | 944 } |
945 | 945 |
946 bool FrameIsChildOfMainFrame(RenderFrameHost* frame) { | 946 bool FrameIsChildOfMainFrame(RenderFrameHost* frame) { |
947 return frame->GetParent() && !frame->GetParent()->GetParent(); | 947 return frame->GetParent() && !frame->GetParent()->GetParent(); |
948 } | 948 } |
949 | 949 |
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2031 bool user_gesture, | 2031 bool user_gesture, |
2032 bool last_unlocked_by_target, | 2032 bool last_unlocked_by_target, |
2033 bool privileged) { | 2033 bool privileged) { |
2034 IPC::IpcSecurityTestUtil::PwnMessageReceived( | 2034 IPC::IpcSecurityTestUtil::PwnMessageReceived( |
2035 process->GetChannel(), | 2035 process->GetChannel(), |
2036 ViewHostMsg_LockMouse(routing_id, user_gesture, last_unlocked_by_target, | 2036 ViewHostMsg_LockMouse(routing_id, user_gesture, last_unlocked_by_target, |
2037 privileged)); | 2037 privileged)); |
2038 } | 2038 } |
2039 | 2039 |
2040 } // namespace content | 2040 } // namespace content |
OLD | NEW |