OLD | NEW |
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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
13 #include "chrome/browser/content_settings/host_content_settings_map.h" | 13 #include "chrome/browser/content_settings/host_content_settings_map.h" |
14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
15 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" | 15 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" |
16 #include "chrome/browser/infobars/infobar.h" | 16 #include "chrome/browser/infobars/infobar.h" |
17 #include "chrome/browser/infobars/infobar_tab_helper.h" | 17 #include "chrome/browser/infobars/infobar_tab_helper.h" |
18 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 18 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
20 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" | 20 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" |
21 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
22 #include "chrome/test/base/testing_profile.h" | 22 #include "chrome/test/base/testing_profile.h" |
23 #include "content/public/browser/navigation_details.h" | 23 #include "content/public/browser/navigation_details.h" |
24 #include "content/public/browser/notification_registrar.h" | 24 #include "content/public/browser/notification_registrar.h" |
25 #include "content/public/browser/notification_service.h" | 25 #include "content/public/browser/notification_service.h" |
26 #include "content/public/browser/web_contents.h" | 26 #include "content/public/browser/web_contents.h" |
27 #include "content/public/test/mock_render_process_host.h" | 27 #include "content/public/test/mock_render_process_host.h" |
28 #include "content/test/test_browser_thread.h" | 28 #include "content/public/test/test_browser_thread.h" |
29 #include "content/test/test_renderer_host.h" | 29 #include "content/test/test_renderer_host.h" |
30 #include "content/test/web_contents_tester.h" | 30 #include "content/test/web_contents_tester.h" |
31 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
32 | 32 |
33 using content::BrowserThread; | 33 using content::BrowserThread; |
34 using content::MockRenderProcessHost; | 34 using content::MockRenderProcessHost; |
35 using content::RenderViewHostTester; | 35 using content::RenderViewHostTester; |
36 using content::WebContents; | 36 using content::WebContents; |
37 using content::WebContentsTester; | 37 using content::WebContentsTester; |
38 | 38 |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 ASSERT_FALSE(infobar_0->ShouldExpire(details)); | 603 ASSERT_FALSE(infobar_0->ShouldExpire(details)); |
604 // Commit the "GoBack()" above, and ensure the infobar is now expired. | 604 // Commit the "GoBack()" above, and ensure the infobar is now expired. |
605 WebContentsTester::For(contents())->CommitPendingNavigation(); | 605 WebContentsTester::For(contents())->CommitPendingNavigation(); |
606 details.entry = contents()->GetController().GetLastCommittedEntry(); | 606 details.entry = contents()->GetController().GetLastCommittedEntry(); |
607 ASSERT_TRUE(infobar_0->ShouldExpire(details)); | 607 ASSERT_TRUE(infobar_0->ShouldExpire(details)); |
608 | 608 |
609 // Delete the tab contents. | 609 // Delete the tab contents. |
610 DeleteContents(); | 610 DeleteContents(); |
611 infobar_0->InfoBarClosed(); | 611 infobar_0->InfoBarClosed(); |
612 } | 612 } |
OLD | NEW |