OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "chrome/browser/extensions/extension_browsertest.h" | 7 #include "chrome/browser/extensions/extension_browsertest.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // can close correctly. The NSWindowController of the Panel window controls | 35 // can close correctly. The NSWindowController of the Panel window controls |
36 // lifetime of the Browser object so we want to release it as soon as | 36 // lifetime of the Browser object so we want to release it as soon as |
37 // possible. In real Chrome, this is done by message pump. | 37 // possible. In real Chrome, this is done by message pump. |
38 // On non-Mac platform, this is an empty class. | 38 // On non-Mac platform, this is an empty class. |
39 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 39 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
40 #endif | 40 #endif |
41 | 41 |
42 EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII(name))); | 42 EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII(name))); |
43 | 43 |
44 ExtensionService* service = browser()->profile()->GetExtensionService(); | 44 ExtensionService* service = browser()->profile()->GetExtensionService(); |
45 const Extension* extension = service->GetExtensionById( | 45 const extensions::Extension* extension = service->GetExtensionById( |
46 last_loaded_extension_id_, false); | 46 last_loaded_extension_id_, false); |
47 EXPECT_TRUE(extension); | 47 EXPECT_TRUE(extension); |
48 | 48 |
49 size_t browser_count = BrowserList::size(); | 49 size_t browser_count = BrowserList::size(); |
50 | 50 |
51 Browser::OpenApplication( | 51 Browser::OpenApplication( |
52 browser()->profile(), | 52 browser()->profile(), |
53 extension, | 53 extension, |
54 // Overriding manifest to open in a panel. | 54 // Overriding manifest to open in a panel. |
55 extension_misc::LAUNCH_PANEL, | 55 extension_misc::LAUNCH_PANEL, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 EXPECT_TRUE(new_browser->is_type_panel()); | 99 EXPECT_TRUE(new_browser->is_type_panel()); |
100 | 100 |
101 // Now also check that PanelManager has one new Panel under management. | 101 // Now also check that PanelManager has one new Panel under management. |
102 EXPECT_EQ(1, panel_manager->num_panels()); | 102 EXPECT_EQ(1, panel_manager->num_panels()); |
103 | 103 |
104 CloseWindowAndWait(new_browser); | 104 CloseWindowAndWait(new_browser); |
105 | 105 |
106 EXPECT_EQ(0, panel_manager->num_panels()); | 106 EXPECT_EQ(0, panel_manager->num_panels()); |
107 EXPECT_EQ(1u, BrowserList::size()); | 107 EXPECT_EQ(1u, BrowserList::size()); |
108 } | 108 } |
OLD | NEW |