| 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 "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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 } | 676 } |
| 677 virtual ~WebContentsDestroyedWatcher() {} | 677 virtual ~WebContentsDestroyedWatcher() {} |
| 678 | 678 |
| 679 // Waits until the WebContents is destroyed. | 679 // Waits until the WebContents is destroyed. |
| 680 void Wait() { | 680 void Wait() { |
| 681 message_loop_runner_->Run(); | 681 message_loop_runner_->Run(); |
| 682 } | 682 } |
| 683 | 683 |
| 684 private: | 684 private: |
| 685 // Overridden WebContentsObserver methods. | 685 // Overridden WebContentsObserver methods. |
| 686 virtual void WebContentsDestroyed( | 686 virtual void WebContentsDestroyed() OVERRIDE { |
| 687 content::WebContents* web_contents) OVERRIDE { | |
| 688 message_loop_runner_->Quit(); | 687 message_loop_runner_->Quit(); |
| 689 } | 688 } |
| 690 | 689 |
| 691 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; | 690 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
| 692 | 691 |
| 693 DISALLOW_COPY_AND_ASSIGN(WebContentsDestroyedWatcher); | 692 DISALLOW_COPY_AND_ASSIGN(WebContentsDestroyedWatcher); |
| 694 }; | 693 }; |
| 695 | 694 |
| 696 // A V1 windowed application. | 695 // A V1 windowed application. |
| 697 class V1App : public TestBrowserWindow { | 696 class V1App : public TestBrowserWindow { |
| (...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2699 | 2698 |
| 2700 EXPECT_EQ(1, app_icon_loader->fetch_count()); | 2699 EXPECT_EQ(1, app_icon_loader->fetch_count()); |
| 2701 ASSERT_EQ(initial_size + 1, model_->items().size()); | 2700 ASSERT_EQ(initial_size + 1, model_->items().size()); |
| 2702 EXPECT_TRUE(launcher_controller_->IsAppPinned("1")); | 2701 EXPECT_TRUE(launcher_controller_->IsAppPinned("1")); |
| 2703 EXPECT_FALSE(launcher_controller_->IsAppPinned("0")); | 2702 EXPECT_FALSE(launcher_controller_->IsAppPinned("0")); |
| 2704 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[app_index].type); | 2703 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[app_index].type); |
| 2705 | 2704 |
| 2706 launcher_controller_->UnpinAppWithID("1"); | 2705 launcher_controller_->UnpinAppWithID("1"); |
| 2707 ASSERT_EQ(initial_size, model_->items().size()); | 2706 ASSERT_EQ(initial_size, model_->items().size()); |
| 2708 } | 2707 } |
| OLD | NEW |