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

Side by Side Diff: Source/web/tests/WebFrameTest.cpp

Issue 790383002: Remove NavigationAction (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 5900 matching lines...) Expand 10 before | Expand all | Expand 10 after
5911 } 5911 }
5912 5912
5913 class TestHistoryWebFrameClient : public FrameTestHelpers::TestWebFrameClient { 5913 class TestHistoryWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
5914 public: 5914 public:
5915 TestHistoryWebFrameClient() 5915 TestHistoryWebFrameClient()
5916 { 5916 {
5917 m_replacesCurrentHistoryItem = false; 5917 m_replacesCurrentHistoryItem = false;
5918 m_frame = 0; 5918 m_frame = 0;
5919 } 5919 }
5920 5920
5921 void didStartProvisionalLoad(WebLocalFrame* frame, bool isTransitionNavigati on) 5921 void didStartProvisionalLoad(WebLocalFrame* frame, bool isTransitionNavigati on, double)
5922 { 5922 {
5923 WebDataSource* ds = frame->provisionalDataSource(); 5923 WebDataSource* ds = frame->provisionalDataSource();
5924 m_replacesCurrentHistoryItem = ds->replacesCurrentHistoryItem(); 5924 m_replacesCurrentHistoryItem = ds->replacesCurrentHistoryItem();
5925 m_frame = frame; 5925 m_frame = frame;
5926 } 5926 }
5927 5927
5928 bool replacesCurrentHistoryItem() { return m_replacesCurrentHistoryItem; } 5928 bool replacesCurrentHistoryItem() { return m_replacesCurrentHistoryItem; }
5929 WebFrame* frame() { return m_frame; } 5929 WebFrame* frame() { return m_frame; }
5930 5930
5931 private: 5931 private:
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
6870 NavigationTransitionCallbackWebFrameClient() 6870 NavigationTransitionCallbackWebFrameClient()
6871 : m_navigationalDataReceivedCount(0) 6871 : m_navigationalDataReceivedCount(0)
6872 , m_provisionalLoadCount(0) 6872 , m_provisionalLoadCount(0)
6873 , m_wasLastProvisionalLoadATransition(false) { } 6873 , m_wasLastProvisionalLoadATransition(false) { }
6874 6874
6875 virtual void addNavigationTransitionData(const WebTransitionElementData& dat a) override 6875 virtual void addNavigationTransitionData(const WebTransitionElementData& dat a) override
6876 { 6876 {
6877 m_navigationalDataReceivedCount++; 6877 m_navigationalDataReceivedCount++;
6878 } 6878 }
6879 6879
6880 virtual void didStartProvisionalLoad(WebLocalFrame* localFrame, bool isTrans itionNavigation) override 6880 virtual void didStartProvisionalLoad(WebLocalFrame* localFrame, bool isTrans itionNavigation, double) override
6881 { 6881 {
6882 m_provisionalLoadCount++; 6882 m_provisionalLoadCount++;
6883 m_wasLastProvisionalLoadATransition = isTransitionNavigation; 6883 m_wasLastProvisionalLoadATransition = isTransitionNavigation;
6884 } 6884 }
6885 6885
6886 unsigned navigationalDataReceivedCount() const { return m_navigationalDataRe ceivedCount; } 6886 unsigned navigationalDataReceivedCount() const { return m_navigationalDataRe ceivedCount; }
6887 unsigned provisionalLoadCount() const { return m_provisionalLoadCount; } 6887 unsigned provisionalLoadCount() const { return m_provisionalLoadCount; }
6888 bool wasLastProvisionalLoadATransition() const { return m_wasLastProvisional LoadATransition; } 6888 bool wasLastProvisionalLoadATransition() const { return m_wasLastProvisional LoadATransition; }
6889 6889
6890 private: 6890 private:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
6924 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6924 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6925 6925
6926 // Neither should a page reload. 6926 // Neither should a page reload.
6927 localFrame->reload(); 6927 localFrame->reload();
6928 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); 6928 EXPECT_EQ(4u, frameClient.provisionalLoadCount());
6929 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); 6929 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition());
6930 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6930 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6931 } 6931 }
6932 6932
6933 } // namespace 6933 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698