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

Unified Diff: ui/aura/test/aura_test_helper.cc

Issue 2660813002: Add WidgetTest::GetAllWidgets() to find dialogs created by TestBrowserDialog. (Closed)
Patch Set: respond to comments Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/test/aura_test_helper.h ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/aura_test_helper.cc
diff --git a/ui/aura/test/aura_test_helper.cc b/ui/aura/test/aura_test_helper.cc
index a232d817d39f72ddb4bcf29b50d9deee3fc10ec6..7c9e5cbb5705cfc8eac579464dc8519c9bd015a9 100644
--- a/ui/aura/test/aura_test_helper.cc
+++ b/ui/aura/test/aura_test_helper.cc
@@ -38,6 +38,11 @@
namespace aura {
namespace test {
+namespace {
+
+AuraTestHelper* g_instance = nullptr;
+
+} // namespace
AuraTestHelper::AuraTestHelper(base::MessageLoopForUI* message_loop)
: setup_called_(false), teardown_called_(false) {
@@ -58,6 +63,11 @@ AuraTestHelper::~AuraTestHelper() {
<< "AuraTestHelper::TearDown() never called.";
}
+// static
+AuraTestHelper* AuraTestHelper::GetInstance() {
+ return g_instance;
+}
+
void AuraTestHelper::EnableMusWithTestWindowTree(
WindowTreeClientDelegate* window_tree_delegate,
WindowManagerDelegate* window_manager_delegate) {
@@ -128,9 +138,12 @@ void AuraTestHelper::SetUp(ui::ContextFactory* context_factory,
if (mode_ == Mode::MUS_CREATE_WINDOW_TREE_CLIENT)
window_tree()->AckAllChanges();
+
+ g_instance = this;
}
void AuraTestHelper::TearDown() {
+ g_instance = nullptr;
teardown_called_ = true;
parenting_client_.reset();
client::SetFocusClient(root_window(), nullptr);
« no previous file with comments | « ui/aura/test/aura_test_helper.h ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698