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

Side by Side Diff: chrome/browser/prerender/prerender_tracker_unittest.cc

Issue 146983002: Move pending prerender logic into PrerenderLinkManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 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 (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 #include <set> 5 #include <set>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 void Start() { 63 void Start() {
64 prerendering_has_started_ = true; 64 prerendering_has_started_ = true;
65 NotifyPrerenderStart(); 65 NotifyPrerenderStart();
66 } 66 }
67 67
68 void Cancel() { 68 void Cancel() {
69 Destroy(FINAL_STATUS_CANCELLED); 69 Destroy(FINAL_STATUS_CANCELLED);
70 } 70 }
71 71
72 void Use() { 72 void Use() {
73 SetFinalStatus(FINAL_STATUS_USED);
74 PrepareForUse(); 73 PrepareForUse();
75 } 74 }
76 75
77 private: 76 private:
78 int child_id_; 77 int child_id_;
79 int route_id_; 78 int route_id_;
80 }; 79 };
81 80
82 class TestPrerenderManager : public PrerenderManager { 81 class TestPrerenderManager : public PrerenderManager {
83 public: 82 public:
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 // We should have cancelled the prerender. 320 // We should have cancelled the prerender.
322 EXPECT_EQ(FINAL_STATUS_BAD_DEFERRED_REDIRECT, 321 EXPECT_EQ(FINAL_STATUS_BAD_DEFERRED_REDIRECT,
323 test_contents()->final_status()); 322 test_contents()->final_status());
324 323
325 // Cleanup work so the prerender is gone. 324 // Cleanup work so the prerender is gone.
326 test_contents()->Cancel(); 325 test_contents()->Cancel();
327 RunEvents(); 326 RunEvents();
328 } 327 }
329 328
330 } // namespace prerender 329 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_manager.cc ('k') | chrome/browser/prerender/prerender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698