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/extensions/extension_view_host_factory.h" | 5 #include "chrome/browser/extensions/extension_view_host_factory.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_browsertest.h" | 7 #include "chrome/browser/extensions/extension_browsertest.h" |
8 #include "chrome/browser/extensions/extension_view_host.h" | 8 #include "chrome/browser/extensions/extension_view_host.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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 EXPECT_TRUE(host->view()); | 46 EXPECT_TRUE(host->view()); |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 // Tests that extensions loaded in incognito mode have the correct profiles | 50 // Tests that extensions loaded in incognito mode have the correct profiles |
51 // for split-mode and non-split-mode. | 51 // for split-mode and non-split-mode. |
52 // Crashing intermittently on multiple platforms. http://crbug.com/316334 | 52 // Crashing intermittently on multiple platforms. http://crbug.com/316334 |
53 IN_PROC_BROWSER_TEST_F(ExtensionViewHostFactoryTest, | 53 IN_PROC_BROWSER_TEST_F(ExtensionViewHostFactoryTest, |
54 DISABLED_IncognitoExtensionHosts) { | 54 DISABLED_IncognitoExtensionHosts) { |
55 // Open an incognito browser. | 55 // Open an incognito browser. |
56 Browser* incognito_browser = ui_test_utils::OpenURLOffTheRecord( | 56 Browser* incognito_browser = |
57 browser()->profile(), GURL("about:blank")); | 57 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); |
58 | 58 |
59 // Load a non-split-mode extension, enabled in incognito. | 59 // Load a non-split-mode extension, enabled in incognito. |
60 scoped_refptr<const Extension> regular_extension = | 60 scoped_refptr<const Extension> regular_extension = |
61 LoadExtensionIncognito(test_data_dir_.AppendASCII("api_test") | 61 LoadExtensionIncognito(test_data_dir_.AppendASCII("api_test") |
62 .AppendASCII("browser_action") | 62 .AppendASCII("browser_action") |
63 .AppendASCII("none")); | 63 .AppendASCII("none")); |
64 ASSERT_TRUE(regular_extension.get()); | 64 ASSERT_TRUE(regular_extension.get()); |
65 | 65 |
66 // The ExtensionHost for a regular extension in an incognito window is | 66 // The ExtensionHost for a regular extension in an incognito window is |
67 // associated with the original window's profile. | 67 // associated with the original window's profile. |
(...skipping 13 matching lines...) Expand all Loading... |
81 // The ExtensionHost for a split-mode extension is associated with the | 81 // The ExtensionHost for a split-mode extension is associated with the |
82 // incognito profile. | 82 // incognito profile. |
83 scoped_ptr<ExtensionHost> split_mode_host( | 83 scoped_ptr<ExtensionHost> split_mode_host( |
84 ExtensionViewHostFactory::CreatePopupHost( | 84 ExtensionViewHostFactory::CreatePopupHost( |
85 split_mode_extension->url(), incognito_browser)); | 85 split_mode_extension->url(), incognito_browser)); |
86 content::BrowserContext* incognito_context = incognito_browser->profile(); | 86 content::BrowserContext* incognito_context = incognito_browser->profile(); |
87 EXPECT_EQ(incognito_context, split_mode_host->browser_context()); | 87 EXPECT_EQ(incognito_context, split_mode_host->browser_context()); |
88 } | 88 } |
89 | 89 |
90 } // namespace extensions | 90 } // namespace extensions |
OLD | NEW |