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

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years 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 | Annotate | Revision Log
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/auto_reset.h" 5 #include "base/auto_reset.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/content_settings/host_content_settings_map.h" 8 #include "chrome/browser/content_settings/host_content_settings_map.h"
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
10 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 10 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 url, 229 url,
230 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, 230 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
231 std::string())); 231 std::string()));
232 EXPECT_EQ(CONTENT_SETTING_ALLOW, 232 EXPECT_EQ(CONTENT_SETTING_ALLOW,
233 host_content_settings_map->GetContentSetting( 233 host_content_settings_map->GetContentSetting(
234 url, 234 url,
235 url, 235 url,
236 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, 236 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
237 std::string())); 237 std::string()));
238 238
239 // Removing an |InfoBarDelegate| from the |InfoBarService| does not delete
240 // it. Hence the |delegate| must be cleaned up after it was removed from the
241 // |infobar_service|.
242 InfoBarService* infobar_service = 239 InfoBarService* infobar_service =
243 InfoBarService::FromWebContents(web_contents()); 240 InfoBarService::FromWebContents(web_contents());
244 scoped_ptr<InfoBarDelegate> delegate(infobar_service->infobar_at(0)); 241 infobar_service->RemoveInfoBar(infobar_service->infobar_at(0));
245 infobar_service->RemoveInfoBar(delegate.get());
246 } 242 }
247 243
248 TEST_F(ContentSettingBubbleModelTest, MediastreamMic) { 244 TEST_F(ContentSettingBubbleModelTest, MediastreamMic) {
249 // Required to break dependency on BrowserMainLoop. 245 // Required to break dependency on BrowserMainLoop.
250 MediaCaptureDevicesDispatcher::GetInstance()-> 246 MediaCaptureDevicesDispatcher::GetInstance()->
251 DisableDeviceEnumerationForTesting(); 247 DisableDeviceEnumerationForTesting();
252 248
253 TabSpecificContentSettings* content_settings = 249 TabSpecificContentSettings* content_settings =
254 TabSpecificContentSettings::FromWebContents(web_contents()); 250 TabSpecificContentSettings::FromWebContents(web_contents());
255 std::string request_host = "google.com"; 251 std::string request_host = "google.com";
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 ProtocolHandler handler = registry.GetHandlerFor("mailto"); 735 ProtocolHandler handler = registry.GetHandlerFor("mailto");
740 ASSERT_FALSE(handler.IsEmpty()); 736 ASSERT_FALSE(handler.IsEmpty());
741 EXPECT_EQ(ASCIIToUTF16("Handler"), handler.title()); 737 EXPECT_EQ(ASCIIToUTF16("Handler"), handler.title());
742 EXPECT_EQ(CONTENT_SETTING_ALLOW, 738 EXPECT_EQ(CONTENT_SETTING_ALLOW,
743 content_settings->pending_protocol_handler_setting()); 739 content_settings->pending_protocol_handler_setting());
744 EXPECT_FALSE(registry.IsIgnored(test_handler)); 740 EXPECT_FALSE(registry.IsIgnored(test_handler));
745 } 741 }
746 742
747 registry.Shutdown(); 743 registry.Shutdown();
748 } 744 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698