| 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 // 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 "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/test/base/ui_test_utils.h" | 26 #include "chrome/test/base/ui_test_utils.h" |
| 27 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 27 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 28 #include "content/browser/tab_contents/tab_contents.h" | 28 #include "content/browser/tab_contents/tab_contents.h" |
| 29 #include "content/browser/tab_contents/tab_contents_view.h" | 29 #include "content/browser/tab_contents/tab_contents_view.h" |
| 30 #include "content/test/test_browser_thread.h" | 30 #include "content/test/test_browser_thread.h" |
| 31 #include "crypto/sha2.h" | 31 #include "crypto/sha2.h" |
| 32 #include "testing/gmock/include/gmock/gmock.h" | 32 #include "testing/gmock/include/gmock/gmock.h" |
| 33 | 33 |
| 34 using base::Histogram; | 34 using base::Histogram; |
| 35 using base::StatisticsRecorder; | 35 using base::StatisticsRecorder; |
| 36 using content::BrowserThread; |
| 36 | 37 |
| 37 using ::testing::_; | 38 using ::testing::_; |
| 38 using ::testing::Mock; | 39 using ::testing::Mock; |
| 39 using ::testing::StrictMock; | 40 using ::testing::StrictMock; |
| 40 | 41 |
| 41 // A SafeBrowingDatabase class that allows us to inject the malicious URLs. | 42 // A SafeBrowingDatabase class that allows us to inject the malicious URLs. |
| 42 class TestSafeBrowsingDatabase : public SafeBrowsingDatabase { | 43 class TestSafeBrowsingDatabase : public SafeBrowsingDatabase { |
| 43 public: | 44 public: |
| 44 TestSafeBrowsingDatabase() {} | 45 TestSafeBrowsingDatabase() {} |
| 45 | 46 |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 | 765 |
| 765 // Delete the Profile. SBS stops again. | 766 // Delete the Profile. SBS stops again. |
| 766 pref_service2 = NULL; | 767 pref_service2 = NULL; |
| 767 profile2.reset(); | 768 profile2.reset(); |
| 768 WaitForIOThread(); | 769 WaitForIOThread(); |
| 769 EXPECT_FALSE(sb_service->enabled()); | 770 EXPECT_FALSE(sb_service->enabled()); |
| 770 EXPECT_FALSE(csd_service->enabled()); | 771 EXPECT_FALSE(csd_service->enabled()); |
| 771 } | 772 } |
| 772 | 773 |
| 773 } // namespace | 774 } // namespace |
| OLD | NEW |