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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc

Issue 1050713002: aura: Remove layerless windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layerless: rebase Created 5 years, 8 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
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 "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowAura); 642 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowAura);
643 }; 643 };
644 644
645 // Creates a test browser window which has a native window. 645 // Creates a test browser window which has a native window.
646 scoped_ptr<TestBrowserWindowAura> CreateTestBrowserWindow( 646 scoped_ptr<TestBrowserWindowAura> CreateTestBrowserWindow(
647 const Browser::CreateParams& params) { 647 const Browser::CreateParams& params) {
648 // Create a window. 648 // Create a window.
649 aura::Window* window = new aura::Window(NULL); 649 aura::Window* window = new aura::Window(NULL);
650 window->set_id(0); 650 window->set_id(0);
651 window->SetType(ui::wm::WINDOW_TYPE_NORMAL); 651 window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
652 window->Init(aura::WINDOW_LAYER_TEXTURED); 652 window->Init(ui::LAYER_TEXTURED);
653 window->Show(); 653 window->Show();
654 654
655 scoped_ptr<TestBrowserWindowAura> browser_window( 655 scoped_ptr<TestBrowserWindowAura> browser_window(
656 new TestBrowserWindowAura(window)); 656 new TestBrowserWindowAura(window));
657 browser_window->CreateBrowser(params); 657 browser_window->CreateBrowser(params);
658 return browser_window.Pass(); 658 return browser_window.Pass();
659 } 659 }
660 660
661 // Watches WebContents and blocks until it is destroyed. This is needed for 661 // Watches WebContents and blocks until it is destroyed. This is needed for
662 // the destruction of a V2 application. 662 // the destruction of a V2 application.
(...skipping 21 matching lines...) Expand all
684 }; 684 };
685 685
686 // A V1 windowed application. 686 // A V1 windowed application.
687 class V1App : public TestBrowserWindow { 687 class V1App : public TestBrowserWindow {
688 public: 688 public:
689 V1App(Profile* profile, const std::string& app_name) { 689 V1App(Profile* profile, const std::string& app_name) {
690 // Create a window. 690 // Create a window.
691 native_window_.reset(new aura::Window(NULL)); 691 native_window_.reset(new aura::Window(NULL));
692 native_window_->set_id(0); 692 native_window_->set_id(0);
693 native_window_->SetType(ui::wm::WINDOW_TYPE_POPUP); 693 native_window_->SetType(ui::wm::WINDOW_TYPE_POPUP);
694 native_window_->Init(aura::WINDOW_LAYER_TEXTURED); 694 native_window_->Init(ui::LAYER_TEXTURED);
695 native_window_->Show(); 695 native_window_->Show();
696 aura::client::ParentWindowWithContext(native_window_.get(), 696 aura::client::ParentWindowWithContext(native_window_.get(),
697 ash::Shell::GetPrimaryRootWindow(), 697 ash::Shell::GetPrimaryRootWindow(),
698 gfx::Rect(10, 10, 20, 30)); 698 gfx::Rect(10, 10, 20, 30));
699 Browser::CreateParams params = 699 Browser::CreateParams params =
700 Browser::CreateParams::CreateForApp(kCrxAppPrefix + app_name, 700 Browser::CreateParams::CreateForApp(kCrxAppPrefix + app_name,
701 true /* trusted_source */, 701 true /* trusted_source */,
702 gfx::Rect(), 702 gfx::Rect(),
703 profile, 703 profile,
704 chrome::HOST_DESKTOP_TYPE_ASH); 704 chrome::HOST_DESKTOP_TYPE_ASH);
(...skipping 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after
2683 2683
2684 EXPECT_EQ(1, app_icon_loader->fetch_count()); 2684 EXPECT_EQ(1, app_icon_loader->fetch_count());
2685 ASSERT_EQ(initial_size + 1, model_->items().size()); 2685 ASSERT_EQ(initial_size + 1, model_->items().size());
2686 EXPECT_TRUE(launcher_controller_->IsAppPinned("1")); 2686 EXPECT_TRUE(launcher_controller_->IsAppPinned("1"));
2687 EXPECT_FALSE(launcher_controller_->IsAppPinned("0")); 2687 EXPECT_FALSE(launcher_controller_->IsAppPinned("0"));
2688 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[app_index].type); 2688 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[app_index].type);
2689 2689
2690 launcher_controller_->UnpinAppWithID("1"); 2690 launcher_controller_->UnpinAppWithID("1");
2691 ASSERT_EQ(initial_size, model_->items().size()); 2691 ASSERT_EQ(initial_size, model_->items().size());
2692 } 2692 }
OLDNEW
« no previous file with comments | « ash/wm/workspace_controller_unittest.cc ('k') | chrome/browser/ui/aura/accessibility/ax_root_obj_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698