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 // This test creates a safebrowsing service using test safebrowsing database | 5 // This test creates a safebrowsing service using test safebrowsing database |
6 // and a test protocol manager. It is used to test logics in safebrowsing | 6 // and a test protocol manager. It is used to test logics in safebrowsing |
7 // service. | 7 // service. |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 EXPECT_FALSE(csd_service->enabled()); | 766 EXPECT_FALSE(csd_service->enabled()); |
767 } | 767 } |
768 | 768 |
769 } // namespace | 769 } // namespace |
770 | 770 |
771 class SafeBrowsingServiceCookieTest : public InProcessBrowserTest { | 771 class SafeBrowsingServiceCookieTest : public InProcessBrowserTest { |
772 public: | 772 public: |
773 SafeBrowsingServiceCookieTest() {} | 773 SafeBrowsingServiceCookieTest() {} |
774 | 774 |
775 virtual void SetUpCommandLine(CommandLine* command_line) { | 775 virtual void SetUpCommandLine(CommandLine* command_line) { |
776 InProcessBrowserTest::SetUpCommandLine(command_line); | |
777 | |
778 // We need to start the test server to get the host&port in the url. | 776 // We need to start the test server to get the host&port in the url. |
779 ASSERT_TRUE(test_server()->Start()); | 777 ASSERT_TRUE(test_server()->Start()); |
780 | 778 |
781 // Makes sure the auto update is not triggered. This test will force the | 779 // Makes sure the auto update is not triggered. This test will force the |
782 // update when needed. | 780 // update when needed. |
783 command_line->AppendSwitch(switches::kSbDisableAutoUpdate); | 781 command_line->AppendSwitch(switches::kSbDisableAutoUpdate); |
784 | 782 |
785 // Point to the testing server for all SafeBrowsing requests. | 783 // Point to the testing server for all SafeBrowsing requests. |
786 GURL url_prefix = test_server()->GetURL( | 784 GURL url_prefix = test_server()->GetURL( |
787 "expect-and-set-cookie?expect=a%3db" | 785 "expect-and-set-cookie?expect=a%3db" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 // save cookies. | 876 // save cookies. |
879 IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceCookieTest, TestSBUpdateCookies) { | 877 IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceCookieTest, TestSBUpdateCookies) { |
880 ui_test_utils::WindowedNotificationObserver observer( | 878 ui_test_utils::WindowedNotificationObserver observer( |
881 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, | 879 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, |
882 content::Source<SafeBrowsingService>(sb_service_.get())); | 880 content::Source<SafeBrowsingService>(sb_service_.get())); |
883 BrowserThread::PostTask( | 881 BrowserThread::PostTask( |
884 BrowserThread::IO, FROM_HERE, | 882 BrowserThread::IO, FROM_HERE, |
885 base::Bind(&SafeBrowsingServiceCookieTest::ForceUpdate, this)); | 883 base::Bind(&SafeBrowsingServiceCookieTest::ForceUpdate, this)); |
886 observer.Wait(); | 884 observer.Wait(); |
887 } | 885 } |
OLD | NEW |