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

Side by Side Diff: chrome/browser/android/offline_pages/prerendering_offliner_unittest.cc

Issue 2843513005: Fix uninitialized pointer in unit tests. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/android/offline_pages/prerendering_offliner.h" 5 #include "chrome/browser/android/offline_pages/prerendering_offliner.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 27 matching lines...) Expand all
38 38
39 // Mock Loader for testing the Offliner calls. 39 // Mock Loader for testing the Offliner calls.
40 class MockPrerenderingLoader : public PrerenderingLoader { 40 class MockPrerenderingLoader : public PrerenderingLoader {
41 public: 41 public:
42 explicit MockPrerenderingLoader(content::BrowserContext* browser_context) 42 explicit MockPrerenderingLoader(content::BrowserContext* browser_context)
43 : PrerenderingLoader(browser_context), 43 : PrerenderingLoader(browser_context),
44 can_prerender_(true), 44 can_prerender_(true),
45 mock_loading_(false), 45 mock_loading_(false),
46 mock_loaded_(false), 46 mock_loaded_(false),
47 mock_is_lowbar_met_(false), 47 mock_is_lowbar_met_(false),
48 start_snapshot_called_(false) {} 48 start_snapshot_called_(false),
49 web_contents_(nullptr) {}
49 ~MockPrerenderingLoader() override { delete web_contents_; } 50 ~MockPrerenderingLoader() override { delete web_contents_; }
50 51
51 bool LoadPage(const GURL& url, 52 bool LoadPage(const GURL& url,
52 const LoadPageCallback& load_done_callback, 53 const LoadPageCallback& load_done_callback,
53 const ProgressCallback& progress_callback) override { 54 const ProgressCallback& progress_callback) override {
54 mock_loading_ = can_prerender_; 55 mock_loading_ = can_prerender_;
55 load_page_callback_ = load_done_callback; 56 load_page_callback_ = load_done_callback;
56 progress_callback_ = progress_callback; 57 progress_callback_ = progress_callback;
57 return mock_loading_; 58 return mock_loading_;
58 } 59 }
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 PumpLoop(); 611 PumpLoop();
611 EXPECT_EQ(Offliner::RequestStatus::SAVED, request_status()); 612 EXPECT_EQ(Offliner::RequestStatus::SAVED, request_status());
612 613
613 // One extra part should be added if the flag is on. 614 // One extra part should be added if the flag is on.
614 content::MHTMLExtraParts* extra_parts = 615 content::MHTMLExtraParts* extra_parts =
615 content::MHTMLExtraParts::FromWebContents(loader()->web_contents()); 616 content::MHTMLExtraParts::FromWebContents(loader()->web_contents());
616 EXPECT_EQ(extra_parts->size(), 1); 617 EXPECT_EQ(extra_parts->size(), 1);
617 } 618 }
618 619
619 } // namespace offline_pages 620 } // namespace offline_pages
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698