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

Side by Side Diff: chrome/browser/ui/panels/panel_browsertest.cc

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 2 Created 8 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
OLDNEW
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/bind.h" 5 #include "base/bind.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/download/download_service.h" 8 #include "chrome/browser/download/download_service.h"
9 #include "chrome/browser/download/download_service_factory.h" 9 #include "chrome/browser/download/download_service_factory.h"
10 #include "chrome/browser/net/url_request_mock_util.h" 10 #include "chrome/browser/net/url_request_mock_util.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "content/public/common/url_constants.h" 42 #include "content/public/common/url_constants.h"
43 #include "content/test/net/url_request_mock_http_job.h" 43 #include "content/test/net/url_request_mock_http_job.h"
44 #include "net/base/net_util.h" 44 #include "net/base/net_util.h"
45 #include "testing/gtest/include/gtest/gtest.h" 45 #include "testing/gtest/include/gtest/gtest.h"
46 #include "ui/gfx/screen.h" 46 #include "ui/gfx/screen.h"
47 47
48 using content::BrowserThread; 48 using content::BrowserThread;
49 using content::DownloadItem; 49 using content::DownloadItem;
50 using content::DownloadManager; 50 using content::DownloadManager;
51 using content::WebContents; 51 using content::WebContents;
52 using extensions::Extension;
52 53
53 class PanelBrowserTest : public BasePanelBrowserTest { 54 class PanelBrowserTest : public BasePanelBrowserTest {
54 public: 55 public:
55 PanelBrowserTest() : BasePanelBrowserTest() { 56 PanelBrowserTest() : BasePanelBrowserTest() {
56 } 57 }
57 58
58 protected: 59 protected:
59 void MoveMouseAndWaitForExpansionStateChange(Panel* panel, 60 void MoveMouseAndWaitForExpansionStateChange(Panel* panel,
60 const gfx::Point& position) { 61 const gfx::Point& position) {
61 ui_test_utils::WindowedNotificationObserver signal( 62 ui_test_utils::WindowedNotificationObserver signal(
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 Panel* panel_other = CreatePanel(extension_app_name_other); 1315 Panel* panel_other = CreatePanel(extension_app_name_other);
1315 1316
1316 ui_test_utils::WindowedNotificationObserver signal( 1317 ui_test_utils::WindowedNotificationObserver signal(
1317 chrome::NOTIFICATION_BROWSER_CLOSED, 1318 chrome::NOTIFICATION_BROWSER_CLOSED,
1318 content::Source<Browser>(panel->browser())); 1319 content::Source<Browser>(panel->browser()));
1319 ui_test_utils::WindowedNotificationObserver signal1( 1320 ui_test_utils::WindowedNotificationObserver signal1(
1320 chrome::NOTIFICATION_BROWSER_CLOSED, 1321 chrome::NOTIFICATION_BROWSER_CLOSED,
1321 content::Source<Browser>(panel1->browser())); 1322 content::Source<Browser>(panel1->browser()));
1322 1323
1323 // Send unload notification on the first extension. 1324 // Send unload notification on the first extension.
1324 UnloadedExtensionInfo details(extension, 1325 extensions::UnloadedExtensionInfo details(extension,
1325 extension_misc::UNLOAD_REASON_UNINSTALL); 1326 extension_misc::UNLOAD_REASON_UNINSTALL);
1326 content::NotificationService::current()->Notify( 1327 content::NotificationService::current()->Notify(
1327 chrome::NOTIFICATION_EXTENSION_UNLOADED, 1328 chrome::NOTIFICATION_EXTENSION_UNLOADED,
1328 content::Source<Profile>(browser()->profile()), 1329 content::Source<Profile>(browser()->profile()),
1329 content::Details<UnloadedExtensionInfo>(&details)); 1330 content::Details<extensions::UnloadedExtensionInfo>(&details));
1330 1331
1331 // Wait for the panels opened by the first extension to close. 1332 // Wait for the panels opened by the first extension to close.
1332 signal.Wait(); 1333 signal.Wait();
1333 signal1.Wait(); 1334 signal1.Wait();
1334 1335
1335 // Verify that the panel that's left is the panel from the second extension. 1336 // Verify that the panel that's left is the panel from the second extension.
1336 EXPECT_EQ(panel_other, panel_manager->panels()[0]); 1337 EXPECT_EQ(panel_other, panel_manager->panels()[0]);
1337 panel_other->Close(); 1338 panel_other->Close();
1338 } 1339 }
1339 1340
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 // position when tall panel brings up its titlebar. 1906 // position when tall panel brings up its titlebar.
1906 CloseWindowAndWait(panel1->browser()); 1907 CloseWindowAndWait(panel1->browser());
1907 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up, 1908 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up,
1908 GetBalloonBottomPosition(balloon)); 1909 GetBalloonBottomPosition(balloon));
1909 1910
1910 // Closing the remaining tall panel should move the notification balloon back 1911 // Closing the remaining tall panel should move the notification balloon back
1911 // to its original position. 1912 // to its original position.
1912 CloseWindowAndWait(panel2->browser()); 1913 CloseWindowAndWait(panel2->browser());
1913 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); 1914 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon));
1914 } 1915 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698