| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <queue> | 5 #include <queue> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 2961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2972 EXPECT_TRUE(widget->GetRootView()); | 2972 EXPECT_TRUE(widget->GetRootView()); |
| 2973 // We only expect a single views::webview in the view hierarchy. | 2973 // We only expect a single views::webview in the view hierarchy. |
| 2974 views::View* aura_webview = FindWebView(widget->GetRootView()); | 2974 views::View* aura_webview = FindWebView(widget->GetRootView()); |
| 2975 ASSERT_TRUE(aura_webview); | 2975 ASSERT_TRUE(aura_webview); |
| 2976 gfx::Rect bounds(aura_webview->bounds()); | 2976 gfx::Rect bounds(aura_webview->bounds()); |
| 2977 EXPECT_TRUE(aura_webview->IsFocusable()); | 2977 EXPECT_TRUE(aura_webview->IsFocusable()); |
| 2978 | 2978 |
| 2979 views::View* other_focusable_view = new views::View(); | 2979 views::View* other_focusable_view = new views::View(); |
| 2980 other_focusable_view->SetBounds(bounds.x() + bounds.width(), bounds.y(), 100, | 2980 other_focusable_view->SetBounds(bounds.x() + bounds.width(), bounds.y(), 100, |
| 2981 100); | 2981 100); |
| 2982 other_focusable_view->SetFocusable(true); | 2982 other_focusable_view->SetFocusBehavior(views::View::FocusBehavior::ALWAYS); |
| 2983 aura_webview->parent()->AddChildView(other_focusable_view); | 2983 aura_webview->parent()->AddChildView(other_focusable_view); |
| 2984 other_focusable_view->SetPosition(gfx::Point(bounds.x() + bounds.width(), 0)); | 2984 other_focusable_view->SetPosition(gfx::Point(bounds.x() + bounds.width(), 0)); |
| 2985 | 2985 |
| 2986 // Sync changes to compositor. | 2986 // Sync changes to compositor. |
| 2987 ForceCompositorFrame(); | 2987 ForceCompositorFrame(); |
| 2988 | 2988 |
| 2989 aura_webview->RequestFocus(); | 2989 aura_webview->RequestFocus(); |
| 2990 // Verify that other_focusable_view can steal focus from aura_webview. | 2990 // Verify that other_focusable_view can steal focus from aura_webview. |
| 2991 EXPECT_TRUE(aura_webview->HasFocus()); | 2991 EXPECT_TRUE(aura_webview->HasFocus()); |
| 2992 other_focusable_view->RequestFocus(); | 2992 other_focusable_view->RequestFocus(); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3091 // 4 tasks expected. The order is arbitrary. | 3091 // 4 tasks expected. The order is arbitrary. |
| 3092 // Tab: about:blank, | 3092 // Tab: about:blank, |
| 3093 // Background Page: <webview> task manager test, | 3093 // Background Page: <webview> task manager test, |
| 3094 // App: <webview> task manager test, | 3094 // App: <webview> task manager test, |
| 3095 // Webview: WebViewed test content. | 3095 // Webview: WebViewed test content. |
| 3096 EXPECT_EQ(4U, task_manager.tasks().size()); | 3096 EXPECT_EQ(4U, task_manager.tasks().size()); |
| 3097 EXPECT_TRUE(HasExpectedGuestTask(task_manager, guest_contents)); | 3097 EXPECT_TRUE(HasExpectedGuestTask(task_manager, guest_contents)); |
| 3098 } | 3098 } |
| 3099 | 3099 |
| 3100 #endif // defined(ENABLE_TASK_MANAGER) | 3100 #endif // defined(ENABLE_TASK_MANAGER) |
| OLD | NEW |