| 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 "base/auto_reset.h" | 5 #include "base/auto_reset.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "chrome/browser/ui/extensions/extension_message_bubble_browsertest.h" | 7 #include "chrome/browser/ui/extensions/extension_message_bubble_browsertest.h" |
| 8 #include "chrome/browser/ui/extensions/settings_api_bubble_helpers.h" | 8 #include "chrome/browser/ui/extensions/settings_api_bubble_helpers.h" |
| 9 #include "chrome/browser/ui/test/test_browser_dialog.h" | 9 #include "chrome/browser/ui/test/test_browser_dialog.h" |
| 10 #include "chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h" | 10 #include "chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 void ExtensionMessageBubbleViewBrowserTest::ClickLearnMoreButton( | 125 void ExtensionMessageBubbleViewBrowserTest::ClickLearnMoreButton( |
| 126 Browser* browser) { | 126 Browser* browser) { |
| 127 ToolbarActionsBarBubbleViews* bubble = GetViewsBubbleForBrowser(browser); | 127 ToolbarActionsBarBubbleViews* bubble = GetViewsBubbleForBrowser(browser); |
| 128 static_cast<views::LinkListener*>(bubble)->LinkClicked( | 128 static_cast<views::LinkListener*>(bubble)->LinkClicked( |
| 129 const_cast<views::Link*>(bubble->learn_more_button()), 0); | 129 const_cast<views::Link*>(bubble->learn_more_button()), 0); |
| 130 | 130 |
| 131 // Clicking a button closes asynchronously. Since the close is asynchronous, | 131 // Clicking a button closes asynchronously. Since the close is asynchronous, |
| 132 // platform events may happen before the close completes and the dialog needs | 132 // platform events may happen before the close completes and the dialog needs |
| 133 // to report a valid state. | 133 // to report a valid state. |
| 134 ui::AXNodeData node_data; | 134 ui::AXNodeData node_data; |
| 135 bubble->GetAccessibleNodeData(&node_data); | 135 bubble->GetWidget()->GetRootView()->GetAccessibleNodeData(&node_data); |
| 136 EXPECT_EQ(ui::AX_ROLE_DIALOG, node_data.role); | 136 EXPECT_EQ(ui::AX_ROLE_DIALOG, node_data.role); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void ExtensionMessageBubbleViewBrowserTest::ClickActionButton( | 139 void ExtensionMessageBubbleViewBrowserTest::ClickActionButton( |
| 140 Browser* browser) { | 140 Browser* browser) { |
| 141 ToolbarActionsBarBubbleViews* bubble = GetViewsBubbleForBrowser(browser); | 141 ToolbarActionsBarBubbleViews* bubble = GetViewsBubbleForBrowser(browser); |
| 142 bubble->GetDialogClientView()->AcceptWindow(); | 142 bubble->GetDialogClientView()->AcceptWindow(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void ExtensionMessageBubbleViewBrowserTest::ClickDismissButton( | 145 void ExtensionMessageBubbleViewBrowserTest::ClickDismissButton( |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 extensions::SetNtpBubbleEnabledForTesting(false); | 274 extensions::SetNtpBubbleEnabledForTesting(false); |
| 275 #endif | 275 #endif |
| 276 ExtensionMessageBubbleViewBrowserTest::TearDownOnMainThread(); | 276 ExtensionMessageBubbleViewBrowserTest::TearDownOnMainThread(); |
| 277 } | 277 } |
| 278 }; | 278 }; |
| 279 | 279 |
| 280 IN_PROC_BROWSER_TEST_F(NtpExtensionBubbleViewBrowserTest, | 280 IN_PROC_BROWSER_TEST_F(NtpExtensionBubbleViewBrowserTest, |
| 281 TestControlledNewTabPageMessageBubbleLearnMore) { | 281 TestControlledNewTabPageMessageBubbleLearnMore) { |
| 282 TestControlledNewTabPageBubbleShown(true); | 282 TestControlledNewTabPageBubbleShown(true); |
| 283 } | 283 } |
| OLD | NEW |