| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/test/histogram_tester.h" | 10 #include "base/test/histogram_tester.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 content::WebContents* GetActiveTab() { | 193 content::WebContents* GetActiveTab() { |
| 194 // First, we need to find the active browser window. It should be at | 194 // First, we need to find the active browser window. It should be at |
| 195 // the same desktop as the browser in which we invoked the bubble. | 195 // the same desktop as the browser in which we invoked the bubble. |
| 196 Browser* active_browser = chrome::FindLastActive(); | 196 Browser* active_browser = chrome::FindLastActive(); |
| 197 return active_browser->tab_strip_model()->GetActiveWebContents(); | 197 return active_browser->tab_strip_model()->GetActiveWebContents(); |
| 198 } | 198 } |
| 199 }; | 199 }; |
| 200 | 200 |
| 201 // Tests that clicking on the management link in the media bubble opens | 201 // Tests that clicking on the management link in the media bubble opens |
| 202 // the correct section of the settings UI. | 202 // the correct section of the settings UI. |
| 203 IN_PROC_BROWSER_TEST_F(ContentSettingBubbleModelMediaStreamTest, ManageLink) { | 203 // This test sometimes leaks memory, detected by linux_chromium_asan_rel_ng. See |
| 204 // http://crbug/668693 for more info. |
| 205 IN_PROC_BROWSER_TEST_F(ContentSettingBubbleModelMediaStreamTest, |
| 206 DISABLED_ManageLink) { |
| 204 // For each of the three options, we click the management link and check if | 207 // For each of the three options, we click the management link and check if |
| 205 // the active tab loads the correct internal url. | 208 // the active tab loads the correct internal url. |
| 206 | 209 |
| 207 // The microphone bubble links to microphone exceptions. | 210 // The microphone bubble links to microphone exceptions. |
| 208 ManageMediaStreamSettings(TabSpecificContentSettings::MICROPHONE_ACCESSED); | 211 ManageMediaStreamSettings(TabSpecificContentSettings::MICROPHONE_ACCESSED); |
| 209 EXPECT_EQ(GURL("chrome://settings/contentExceptions#media-stream-mic"), | 212 EXPECT_EQ(GURL("chrome://settings/contentExceptions#media-stream-mic"), |
| 210 GetActiveTab()->GetLastCommittedURL()); | 213 GetActiveTab()->GetLastCommittedURL()); |
| 211 | 214 |
| 212 // The bubble for both media devices links to the the first section of the | 215 // The bubble for both media devices links to the the first section of the |
| 213 // default media content settings, which is the microphone section. | 216 // default media content settings, which is the microphone section. |
| 214 ManageMediaStreamSettings(TabSpecificContentSettings::MICROPHONE_ACCESSED | | 217 ManageMediaStreamSettings(TabSpecificContentSettings::MICROPHONE_ACCESSED | |
| 215 TabSpecificContentSettings::CAMERA_ACCESSED); | 218 TabSpecificContentSettings::CAMERA_ACCESSED); |
| 216 EXPECT_EQ(GURL("chrome://settings/content#media-stream-mic"), | 219 EXPECT_EQ(GURL("chrome://settings/content#media-stream-mic"), |
| 217 GetActiveTab()->GetLastCommittedURL()); | 220 GetActiveTab()->GetLastCommittedURL()); |
| 218 | 221 |
| 219 // In ChromeOS, we do not sanitize chrome://settings-frame to | 222 // In ChromeOS, we do not sanitize chrome://settings-frame to |
| 220 // chrome://settings for same-document navigations. See crbug.com/416157. For | 223 // chrome://settings for same-document navigations. See crbug.com/416157. For |
| 221 // this reason, order the tests so no same-document navigation occurs. | 224 // this reason, order the tests so no same-document navigation occurs. |
| 222 | 225 |
| 223 // The camera bubble links to camera exceptions. | 226 // The camera bubble links to camera exceptions. |
| 224 ManageMediaStreamSettings(TabSpecificContentSettings::CAMERA_ACCESSED); | 227 ManageMediaStreamSettings(TabSpecificContentSettings::CAMERA_ACCESSED); |
| 225 EXPECT_EQ(GURL("chrome://settings/contentExceptions#media-stream-camera"), | 228 EXPECT_EQ(GURL("chrome://settings/contentExceptions#media-stream-camera"), |
| 226 GetActiveTab()->GetLastCommittedURL()); | 229 GetActiveTab()->GetLastCommittedURL()); |
| 227 } | 230 } |
| OLD | NEW |