OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <list> | 5 #include <list> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 int reasons = prefs->GetDisableReasons(id); | 299 int reasons = prefs->GetDisableReasons(id); |
300 EXPECT_TRUE(reasons & Extension::DISABLE_CORRUPTED); | 300 EXPECT_TRUE(reasons & Extension::DISABLE_CORRUPTED); |
301 | 301 |
302 // This needs to happen before the ExtensionRegistry gets deleted, which | 302 // This needs to happen before the ExtensionRegistry gets deleted, which |
303 // happens before TearDownOnMainThread is called. | 303 // happens before TearDownOnMainThread is called. |
304 unload_observer_.reset(); | 304 unload_observer_.reset(); |
305 } | 305 } |
306 | 306 |
307 protected: | 307 protected: |
308 JobDelegate delegate_; | 308 JobDelegate delegate_; |
309 scoped_ptr<UnloadObserver> unload_observer_; | 309 std::unique_ptr<UnloadObserver> unload_observer_; |
310 GURL page_url_; | 310 GURL page_url_; |
311 }; | 311 }; |
312 | 312 |
313 IN_PROC_BROWSER_TEST_F(ContentVerifierTest, FailOnRead) { | 313 IN_PROC_BROWSER_TEST_F(ContentVerifierTest, FailOnRead) { |
314 EXPECT_EQ(0, delegate_.bytes_read_failed()); | 314 EXPECT_EQ(0, delegate_.bytes_read_failed()); |
315 delegate_.fail_next_read(); | 315 delegate_.fail_next_read(); |
316 OpenPageAndWaitForUnload(); | 316 OpenPageAndWaitForUnload(); |
317 EXPECT_EQ(1, delegate_.bytes_read_failed()); | 317 EXPECT_EQ(1, delegate_.bytes_read_failed()); |
318 } | 318 } |
319 | 319 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 job_observer.ExpectJobResult(id, | 417 job_observer.ExpectJobResult(id, |
418 base::FilePath(FILE_PATH_LITERAL("script.js")), | 418 base::FilePath(FILE_PATH_LITERAL("script.js")), |
419 JobObserver::Result::FAILURE); | 419 JobObserver::Result::FAILURE); |
420 EnableExtension(id); | 420 EnableExtension(id); |
421 EXPECT_TRUE(job_observer.WaitForExpectedJobs()); | 421 EXPECT_TRUE(job_observer.WaitForExpectedJobs()); |
422 | 422 |
423 ContentVerifyJob::SetObserverForTests(NULL); | 423 ContentVerifyJob::SetObserverForTests(NULL); |
424 } | 424 } |
425 | 425 |
426 } // namespace extensions | 426 } // namespace extensions |
OLD | NEW |