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

Side by Side Diff: ash/shelf/shelf_window_watcher_unittest.cc

Issue 2897993003: chromeos: converts WindowResizer to aura::Window (Closed)
Patch Set: remove include from exo Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « ash/frame/caption_buttons/frame_size_button.cc ('k') | ash/wm/default_state.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/shelf/shelf_window_watcher.h" 5 #include "ash/shelf/shelf_window_watcher.h"
6 6
7 #include "ash/public/cpp/config.h" 7 #include "ash/public/cpp/config.h"
8 #include "ash/public/cpp/shelf_item.h" 8 #include "ash/public/cpp/shelf_item.h"
9 #include "ash/public/cpp/shell_window_ids.h" 9 #include "ash/public/cpp/shell_window_ids.h"
10 #include "ash/public/cpp/window_properties.h" 10 #include "ash/public/cpp/window_properties.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 CreateTestWidget(nullptr, kShellWindowId_DefaultContainer, gfx::Rect()); 235 CreateTestWidget(nullptr, kShellWindowId_DefaultContainer, gfx::Rect());
236 236
237 // Create a ShelfItem for the window. 237 // Create a ShelfItem for the window.
238 ShelfID id = CreateShelfItem(widget->GetNativeWindow()); 238 ShelfID id = CreateShelfItem(widget->GetNativeWindow());
239 EXPECT_EQ(2, model_->item_count()); 239 EXPECT_EQ(2, model_->item_count());
240 240
241 int index = model_->ItemIndexByID(id); 241 int index = model_->ItemIndexByID(id);
242 EXPECT_EQ(STATUS_ACTIVE, model_->items()[index].status); 242 EXPECT_EQ(STATUS_ACTIVE, model_->items()[index].status);
243 243
244 // Simulate dragging of the window and check its item is not changed. 244 // Simulate dragging of the window and check its item is not changed.
245 std::unique_ptr<WindowResizer> resizer(CreateWindowResizer( 245 std::unique_ptr<WindowResizer> resizer(
246 WmWindow::Get(widget->GetNativeWindow()), gfx::Point(), HTCAPTION, 246 CreateWindowResizer(widget->GetNativeWindow(), gfx::Point(), HTCAPTION,
247 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); 247 aura::client::WINDOW_MOVE_SOURCE_MOUSE));
248 ASSERT_TRUE(resizer.get()); 248 ASSERT_TRUE(resizer.get());
249 resizer->Drag(gfx::Point(50, 50), 0); 249 resizer->Drag(gfx::Point(50, 50), 0);
250 resizer->CompleteDrag(); 250 resizer->CompleteDrag();
251 251
252 // Index and id are not changed after dragging the window. 252 // Index and id are not changed after dragging the window.
253 EXPECT_EQ(index, model_->ItemIndexByID(id)); 253 EXPECT_EQ(index, model_->ItemIndexByID(id));
254 EXPECT_EQ(id, model_->items()[index].id); 254 EXPECT_EQ(id, model_->items()[index].id);
255 } 255 }
256 256
257 // Ensure shelf items are added and removed as panels are opened and closed. 257 // Ensure shelf items are added and removed as panels are opened and closed.
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 CreateTestWidget(nullptr, kShellWindowId_DefaultContainer, gfx::Rect()); 345 CreateTestWidget(nullptr, kShellWindowId_DefaultContainer, gfx::Rect());
346 ShelfWindowWatcherTest::CreateShelfItem(widget->GetNativeWindow()); 346 ShelfWindowWatcherTest::CreateShelfItem(widget->GetNativeWindow());
347 EXPECT_EQ(1, model->item_count()); 347 EXPECT_EQ(1, model->item_count());
348 348
349 // Start the test user session; ShelfWindowWatcher will find the open window. 349 // Start the test user session; ShelfWindowWatcher will find the open window.
350 SetSessionStarted(true); 350 SetSessionStarted(true);
351 EXPECT_EQ(2, model->item_count()); 351 EXPECT_EQ(2, model->item_count());
352 } 352 }
353 353
354 } // namespace ash 354 } // namespace ash
OLDNEW
« no previous file with comments | « ash/frame/caption_buttons/frame_size_button.cc ('k') | ash/wm/default_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698