OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/app_list/views/app_list_view.h" | 5 #include "ui/app_list/views/app_list_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 views::Widget::InitParams* params, | 220 views::Widget::InitParams* params, |
221 views::internal::NativeWidgetDelegate* delegate) { | 221 views::internal::NativeWidgetDelegate* delegate) { |
222 // Mimic the logic in ChromeViewsDelegate::OnBeforeWidgetInit(). Except, for | 222 // Mimic the logic in ChromeViewsDelegate::OnBeforeWidgetInit(). Except, for |
223 // ChromeOS, use the root window from the AuraTestHelper rather than depending | 223 // ChromeOS, use the root window from the AuraTestHelper rather than depending |
224 // on ash::Shell:GetPrimaryRootWindow(). Also assume non-ChromeOS is never the | 224 // on ash::Shell:GetPrimaryRootWindow(). Also assume non-ChromeOS is never the |
225 // Ash desktop, as that is covered by AppListViewTestAura. | 225 // Ash desktop, as that is covered by AppListViewTestAura. |
226 #if defined(OS_CHROMEOS) | 226 #if defined(OS_CHROMEOS) |
227 if (!params->parent && !params->context) | 227 if (!params->parent && !params->context) |
228 params->context = parent_->GetContext(); | 228 params->context = parent_->GetContext(); |
229 #elif defined(USE_AURA) | 229 #elif defined(USE_AURA) |
230 if (params->parent == NULL && params->context == NULL && params->top_level) | 230 if (params->parent == NULL && params->context == NULL && !params->child) |
231 params->native_widget = new views::DesktopNativeWidgetAura(delegate); | 231 params->native_widget = new views::DesktopNativeWidgetAura(delegate); |
232 #endif | 232 #endif |
233 } | 233 } |
234 | 234 |
235 } // namespace | 235 } // namespace |
236 | 236 |
237 // Tests showing the app list with basic test model in an ash-style root window. | 237 // Tests showing the app list with basic test model in an ash-style root window. |
238 TEST_P(AppListViewTestAura, Display) { | 238 TEST_P(AppListViewTestAura, Display) { |
239 EXPECT_NO_FATAL_FAILURE(test_context_->RunDisplayTest()); | 239 EXPECT_NO_FATAL_FAILURE(test_context_->RunDisplayTest()); |
240 } | 240 } |
241 | 241 |
242 // Tests showing the app list on the desktop. Note on ChromeOS, this will still | 242 // Tests showing the app list on the desktop. Note on ChromeOS, this will still |
243 // use the regular root window. | 243 // use the regular root window. |
244 TEST_P(AppListViewTestDesktop, Display) { | 244 TEST_P(AppListViewTestDesktop, Display) { |
245 EXPECT_NO_FATAL_FAILURE(test_context_->RunDisplayTest()); | 245 EXPECT_NO_FATAL_FAILURE(test_context_->RunDisplayTest()); |
246 } | 246 } |
247 | 247 |
248 INSTANTIATE_TEST_CASE_P(AppListViewTestAuraInstance, | 248 INSTANTIATE_TEST_CASE_P(AppListViewTestAuraInstance, |
249 AppListViewTestAura, | 249 AppListViewTestAura, |
250 ::testing::Bool()); | 250 ::testing::Bool()); |
251 | 251 |
252 INSTANTIATE_TEST_CASE_P(AppListViewTestDesktopInstance, | 252 INSTANTIATE_TEST_CASE_P(AppListViewTestDesktopInstance, |
253 AppListViewTestDesktop, | 253 AppListViewTestDesktop, |
254 ::testing::Bool()); | 254 ::testing::Bool()); |
255 | 255 |
256 } // namespace test | 256 } // namespace test |
257 } // namespace app_list | 257 } // namespace app_list |
OLD | NEW |