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/geolocation/geolocation_permission_context.h" | 5 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
6 | 6 |
7 #include "base/scoped_vector.h" | 7 #include "base/scoped_vector.h" |
8 #include "chrome/browser/browser_thread.h" | 8 #include "chrome/browser/browser_thread.h" |
9 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 9 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" |
10 #include "chrome/browser/geolocation/geolocation_permission_context.h" | 10 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
11 #include "chrome/browser/geolocation/location_arbitrator.h" | 11 #include "chrome/browser/geolocation/location_arbitrator.h" |
12 #include "chrome/browser/geolocation/location_provider.h" | 12 #include "chrome/browser/geolocation/location_provider.h" |
13 #include "chrome/browser/geolocation/mock_location_provider.h" | 13 #include "chrome/browser/geolocation/mock_location_provider.h" |
14 #include "chrome/browser/renderer_host/mock_render_process_host.h" | 14 #include "chrome/browser/renderer_host/mock_render_process_host.h" |
15 #include "chrome/browser/renderer_host/test/test_render_view_host.h" | 15 #include "chrome/browser/renderer_host/test/test_render_view_host.h" |
16 #include "chrome/browser/tab_contents/infobar_delegate.h" | 16 #include "chrome/browser/tab_contents/infobar_delegate.h" |
17 #include "chrome/browser/tab_contents/test_tab_contents.h" | 17 #include "chrome/browser/tab_contents/test_tab_contents.h" |
18 #include "chrome/common/notification_details.h" | 18 #include "chrome/common/notification_details.h" |
19 #include "chrome/common/notification_type.h" | 19 #include "chrome/common/notification_type.h" |
20 #include "chrome/common/render_messages.h" | 20 #include "chrome/common/render_messages.h" |
21 #include "chrome/test/testing_profile.h" | 21 #include "chrome/test/testing_profile.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
23 | 23 |
| 24 namespace { |
| 25 |
24 // TestTabContents short-circuits TAB_CONTENTS_INFOBAR_REMOVED to call | 26 // TestTabContents short-circuits TAB_CONTENTS_INFOBAR_REMOVED to call |
25 // InfoBarClosed() directly. We need to observe it and call InfoBarClosed() | 27 // InfoBarClosed() directly. We need to observe it and call InfoBarClosed() |
26 // later. | 28 // later. |
27 class TestTabContentsWithPendingInfoBar : public TestTabContents { | 29 class TestTabContentsWithPendingInfoBar : public TestTabContents { |
28 public: | 30 public: |
29 TestTabContentsWithPendingInfoBar(Profile* profile, SiteInstance* instance) | 31 TestTabContentsWithPendingInfoBar(Profile* profile, SiteInstance* instance) |
30 : TestTabContents(profile, instance), | 32 : TestTabContents(profile, instance), |
31 removed_infobar_delegate_(NULL) { | 33 removed_infobar_delegate_(NULL) { |
32 } | 34 } |
33 | 35 |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 // Ensure only one infobar is created. | 416 // Ensure only one infobar is created. |
415 EXPECT_EQ(1, contents()->infobar_delegate_count()); | 417 EXPECT_EQ(1, contents()->infobar_delegate_count()); |
416 ConfirmInfoBarDelegate* infobar_0 = | 418 ConfirmInfoBarDelegate* infobar_0 = |
417 contents()->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); | 419 contents()->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); |
418 ASSERT_TRUE(infobar_0); | 420 ASSERT_TRUE(infobar_0); |
419 string16 text_0 = infobar_0->GetMessageText(); | 421 string16 text_0 = infobar_0->GetMessageText(); |
420 | 422 |
421 // Delete the tab contents. | 423 // Delete the tab contents. |
422 DeleteContents(); | 424 DeleteContents(); |
423 } | 425 } |
| 426 |
| 427 } // namespace |
OLD | NEW |