| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ash/test/ash_test_base.h" | 5 #include "ash/test/ash_test_base.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "chrome/browser/extensions/test_extension_environment.h" | 7 #include "chrome/browser/extensions/test_extension_environment.h" |
| 8 #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.h" | 8 #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.h" |
| 9 #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h" | 9 #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 base::MakeUnique<arc::ArcAuthService>(bridge_service_.get()); | 38 base::MakeUnique<arc::ArcAuthService>(bridge_service_.get()); |
| 39 auth_service_->OnPrimaryUserProfilePrepared( | 39 auth_service_->OnPrimaryUserProfilePrepared( |
| 40 extension_environment_.profile()); | 40 extension_environment_.profile()); |
| 41 #endif | 41 #endif |
| 42 widget_ = views::DialogDelegate::CreateDialogWidget( | 42 widget_ = views::DialogDelegate::CreateDialogWidget( |
| 43 new views::DialogDelegateView(), CurrentContext(), NULL); | 43 new views::DialogDelegateView(), CurrentContext(), NULL); |
| 44 dialog_ = new AppInfoDialog( | 44 dialog_ = new AppInfoDialog( |
| 45 widget_->GetNativeWindow(), extension_environment_.profile(), | 45 widget_->GetNativeWindow(), extension_environment_.profile(), |
| 46 extension_environment_.MakePackagedApp(kTestExtensionId, true).get()); | 46 extension_environment_.MakePackagedApp(kTestExtensionId, true).get()); |
| 47 widget_->GetContentsView()->AddChildView(dialog_); | 47 widget_->GetContentsView()->AddChildView(dialog_); |
| 48 widget_->Show(); |
| 48 } | 49 } |
| 49 | 50 |
| 50 void TearDown() override { | 51 void TearDown() override { |
| 51 widget_->CloseNow(); | 52 widget_->CloseNow(); |
| 52 #if defined(OS_CHROMEOS) | 53 #if defined(OS_CHROMEOS) |
| 53 if (auth_service_) | 54 if (auth_service_) |
| 54 auth_service_->Shutdown(); | 55 auth_service_->Shutdown(); |
| 55 #endif | 56 #endif |
| 56 ash::test::AshTestBase::TearDown(); | 57 ash::test::AshTestBase::TearDown(); |
| 57 } | 58 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 85 dialog_footer->SetPinnedToShelf(true); | 86 dialog_footer->SetPinnedToShelf(true); |
| 86 EXPECT_FALSE(pin_button->visible()); | 87 EXPECT_FALSE(pin_button->visible()); |
| 87 EXPECT_TRUE(unpin_button->visible()); | 88 EXPECT_TRUE(unpin_button->visible()); |
| 88 EXPECT_TRUE(unpin_button->HasFocus()); | 89 EXPECT_TRUE(unpin_button->HasFocus()); |
| 89 | 90 |
| 90 dialog_footer->SetPinnedToShelf(false); | 91 dialog_footer->SetPinnedToShelf(false); |
| 91 EXPECT_TRUE(pin_button->visible()); | 92 EXPECT_TRUE(pin_button->visible()); |
| 92 EXPECT_FALSE(unpin_button->visible()); | 93 EXPECT_FALSE(unpin_button->visible()); |
| 93 EXPECT_TRUE(pin_button->HasFocus()); | 94 EXPECT_TRUE(pin_button->HasFocus()); |
| 94 } | 95 } |
| OLD | NEW |