Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: components/dom_distiller/core/dom_distiller_service_unittest.cc

Issue 140113002: Fix memory leak in readingListPrivate api test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: inline Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/dom_distiller/core/dom_distiller_service.h" 5 #include "components/dom_distiller/core/dom_distiller_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 } // namespace 60 } // namespace
61 61
62 class DomDistillerServiceTest : public testing::Test { 62 class DomDistillerServiceTest : public testing::Test {
63 public: 63 public:
64 virtual void SetUp() { 64 virtual void SetUp() {
65 main_loop_.reset(new base::MessageLoop()); 65 main_loop_.reset(new base::MessageLoop());
66 FakeDB* fake_db = new FakeDB(&db_model_); 66 FakeDB* fake_db = new FakeDB(&db_model_);
67 FakeDB::EntryMap store_model; 67 FakeDB::EntryMap store_model;
68 store_ = test::util::CreateStoreWithFakeDB(fake_db, &store_model); 68 store_ = test::util::CreateStoreWithFakeDB(fake_db, store_model);
69 distiller_factory_ = new MockDistillerFactory(); 69 distiller_factory_ = new MockDistillerFactory();
70 service_.reset(new DomDistillerService( 70 service_.reset(new DomDistillerService(
71 scoped_ptr<DomDistillerStoreInterface>(store_), 71 scoped_ptr<DomDistillerStoreInterface>(store_),
72 scoped_ptr<DistillerFactory>(distiller_factory_))); 72 scoped_ptr<DistillerFactory>(distiller_factory_)));
73 fake_db->InitCallback(true); 73 fake_db->InitCallback(true);
74 fake_db->LoadCallback(true); 74 fake_db->LoadCallback(true);
75 } 75 }
76 76
77 virtual void TearDown() { 77 virtual void TearDown() {
78 base::RunLoop().RunUntilIdle(); 78 base::RunLoop().RunUntilIdle();
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 service_->AddToList(url, ArticleCallback(&article_cb[i]))); 348 service_->AddToList(url, ArticleCallback(&article_cb[i])));
349 EXPECT_CALL(article_cb[i], DistillationCompleted(false)); 349 EXPECT_CALL(article_cb[i], DistillationCompleted(false));
350 } 350 }
351 351
352 service_->RemoveEntry(entry_id); 352 service_->RemoveEntry(entry_id);
353 base::RunLoop().RunUntilIdle(); 353 base::RunLoop().RunUntilIdle();
354 } 354 }
355 355
356 } // namespace test 356 } // namespace test
357 } // namespace dom_distiller 357 } // namespace dom_distiller
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698