OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_action_test_util.h" | 5 #include "chrome/browser/extensions/browser_action_test_util.h" |
6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/extension_test_message_listener.h" | 8 #include "chrome/browser/extensions/extension_test_message_listener.h" |
9 #include "chrome/browser/extensions/user_script_master.h" | 9 #include "chrome/browser/extensions/user_script_master.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // accidentially create and incognito profile. | 85 // accidentially create and incognito profile. |
86 // Test disabled due to http://crbug.com/89054. | 86 // Test disabled due to http://crbug.com/89054. |
87 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_DontCreateIncognitoProfile) { | 87 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_DontCreateIncognitoProfile) { |
88 ASSERT_FALSE(browser()->profile()->HasOffTheRecordProfile()); | 88 ASSERT_FALSE(browser()->profile()->HasOffTheRecordProfile()); |
89 ASSERT_TRUE(RunExtensionTestIncognito( | 89 ASSERT_TRUE(RunExtensionTestIncognito( |
90 "incognito/dont_create_profile")) << message_; | 90 "incognito/dont_create_profile")) << message_; |
91 ASSERT_FALSE(browser()->profile()->HasOffTheRecordProfile()); | 91 ASSERT_FALSE(browser()->profile()->HasOffTheRecordProfile()); |
92 } | 92 } |
93 | 93 |
94 #if defined(OS_WIN) | 94 #if defined(OS_WIN) |
95 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FLAKY_Incognito) { | 95 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_Incognito) { |
96 #else | 96 #else |
97 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Incognito) { | 97 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Incognito) { |
98 #endif | 98 #endif |
99 host_resolver()->AddRule("*", "127.0.0.1"); | 99 host_resolver()->AddRule("*", "127.0.0.1"); |
100 ASSERT_TRUE(StartTestServer()); | 100 ASSERT_TRUE(StartTestServer()); |
101 | 101 |
102 ResultCatcher catcher; | 102 ResultCatcher catcher; |
103 | 103 |
104 // Open incognito window and navigate to test page. | 104 // Open incognito window and navigate to test page. |
105 ui_test_utils::OpenURLOffTheRecord( | 105 ui_test_utils::OpenURLOffTheRecord( |
106 browser()->profile(), | 106 browser()->profile(), |
107 test_server()->GetURL("files/extensions/test_file.html")); | 107 test_server()->GetURL("files/extensions/test_file.html")); |
108 | 108 |
109 ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ | 109 ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ |
110 .AppendASCII("incognito").AppendASCII("apis"))); | 110 .AppendASCII("incognito").AppendASCII("apis"))); |
111 | 111 |
112 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 112 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
113 } | 113 } |
114 | 114 |
115 // Tests that the APIs in an incognito-enabled split-mode extension work | 115 // Tests that the APIs in an incognito-enabled split-mode extension work |
116 // properly. | 116 // properly. |
117 #if defined(OS_WIN) | 117 #if defined(OS_WIN) |
118 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FLAKY_IncognitoSplitMode) { | 118 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_IncognitoSplitMode) { |
119 #else | 119 #else |
120 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoSplitMode) { | 120 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoSplitMode) { |
121 #endif | 121 #endif |
122 host_resolver()->AddRule("*", "127.0.0.1"); | 122 host_resolver()->AddRule("*", "127.0.0.1"); |
123 ASSERT_TRUE(StartTestServer()); | 123 ASSERT_TRUE(StartTestServer()); |
124 | 124 |
125 // We need 2 ResultCatchers because we'll be running the same test in both | 125 // We need 2 ResultCatchers because we'll be running the same test in both |
126 // regular and incognito mode. | 126 // regular and incognito mode. |
127 ResultCatcher catcher; | 127 ResultCatcher catcher; |
128 catcher.RestrictToProfile(browser()->profile()); | 128 catcher.RestrictToProfile(browser()->profile()); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 test_server()->GetURL("files/extensions/test_file.html")); | 192 test_server()->GetURL("files/extensions/test_file.html")); |
193 | 193 |
194 Browser* incognito_browser = BrowserList::FindTabbedBrowser( | 194 Browser* incognito_browser = BrowserList::FindTabbedBrowser( |
195 browser()->profile()->GetOffTheRecordProfile(), false); | 195 browser()->profile()->GetOffTheRecordProfile(), false); |
196 | 196 |
197 // Simulate the incognito's browser action being clicked. | 197 // Simulate the incognito's browser action being clicked. |
198 BrowserActionTestUtil(incognito_browser).Press(0); | 198 BrowserActionTestUtil(incognito_browser).Press(0); |
199 | 199 |
200 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 200 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
201 } | 201 } |
OLD | NEW |