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

Side by Side Diff: content/public/test/browser_test_utils.cc

Issue 1155993003: Fix accessibility with out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing unittests Created 5 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
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 "content/public/test/browser_test_utils.h" 5 #include "content/public/test/browser_test_utils.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 1006
1007 void FrameWatcher::WaitFrames(int frames_to_wait) { 1007 void FrameWatcher::WaitFrames(int frames_to_wait) {
1008 if (frames_to_wait <= 0) 1008 if (frames_to_wait <= 0)
1009 return; 1009 return;
1010 base::RunLoop run_loop; 1010 base::RunLoop run_loop;
1011 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); 1011 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure());
1012 base::AutoReset<int> reset_frames_to_wait(&frames_to_wait_, frames_to_wait); 1012 base::AutoReset<int> reset_frames_to_wait(&frames_to_wait_, frames_to_wait);
1013 run_loop.Run(); 1013 run_loop.Run();
1014 } 1014 }
1015 1015
1016 RenderFrameDeletedObserver::RenderFrameDeletedObserver(
1017 RenderFrameHost* rfh)
1018 : WebContentsObserver(WebContents::FromRenderFrameHost(rfh)),
1019 process_id_(rfh->GetProcess()->GetID()),
1020 routing_id_(rfh->GetRoutingID()),
1021 deleted_(false) {
1022 }
1023
1024 RenderFrameDeletedObserver::~RenderFrameDeletedObserver() {
1025 }
1026
1027 void RenderFrameDeletedObserver::RenderFrameDeleted(
1028 RenderFrameHost* render_frame_host) {
1029 if (render_frame_host->GetProcess()->GetID() == process_id_ &&
1030 render_frame_host->GetRoutingID() == routing_id_) {
1031 deleted_ = true;
1032
1033 if (runner_.get())
1034 runner_->Quit();
1035 }
1036 }
1037
1038 bool RenderFrameDeletedObserver::deleted() {
1039 return deleted_;
1040 }
1041
1042 void RenderFrameDeletedObserver::WaitUntilDeleted() {
1043 if (deleted_)
1044 return;
1045
1046 runner_.reset(new base::RunLoop());
1047 runner_->Run();
1048 runner_.reset(nullptr);
1049 }
1050
1016 } // namespace content 1051 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698