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

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

Issue 23506013: Make the embedder responsible for creating the WebFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix style Created 7 years, 3 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
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 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 m_webView->close(); 1999 m_webView->close();
2000 m_webView = 0; 2000 m_webView = 0;
2001 } 2001 }
2002 2002
2003 class TestDidCreateFrameWebFrameClient : public WebFrameClient { 2003 class TestDidCreateFrameWebFrameClient : public WebFrameClient {
2004 public: 2004 public:
2005 TestDidCreateFrameWebFrameClient() : m_frameCount(0), m_parent(0) 2005 TestDidCreateFrameWebFrameClient() : m_frameCount(0), m_parent(0)
2006 { 2006 {
2007 } 2007 }
2008 2008
2009 virtual void didCreateFrame(WebFrame* parent, WebFrame* child) 2009 virtual WebFrame* didCreateFrame(WebString name)
2010 { 2010 {
2011 m_frameCount++; 2011 m_frameCount++;
2012 /*
2012 if (!m_parent) 2013 if (!m_parent)
2013 m_parent = parent; 2014 m_parent = parent;
2015 */
2016 return 0;
2014 } 2017 }
2015 2018
2016 int m_frameCount; 2019 int m_frameCount;
2017 WebFrame* m_parent; 2020 WebFrame* m_parent;
2018 }; 2021 };
2019 2022
2020 TEST_F(WebFrameTest, DidCreateFrame) 2023 TEST_F(WebFrameTest, DidCreateFrame)
2021 { 2024 {
2022 registerMockedHttpURLLoad("iframes_test.html"); 2025 registerMockedHttpURLLoad("iframes_test.html");
2023 registerMockedHttpURLLoad("visible_iframe.html"); 2026 registerMockedHttpURLLoad("visible_iframe.html");
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
3593 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "push_state.h tml", true, 0, &client); 3596 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "push_state.h tml", true, 0, &client);
3594 runPendingTasks(); 3597 runPendingTasks();
3595 3598
3596 EXPECT_EQ(client.startLoadingCount(), 2); 3599 EXPECT_EQ(client.startLoadingCount(), 2);
3597 EXPECT_EQ(client.stopLoadingCount(), 2); 3600 EXPECT_EQ(client.stopLoadingCount(), 2);
3598 m_webView->close(); 3601 m_webView->close();
3599 m_webView = 0; 3602 m_webView = 0;
3600 } 3603 }
3601 3604
3602 } // namespace 3605 } // namespace
OLDNEW
« no previous file with comments | « Source/web/WebFrameImpl.cpp ('k') | public/web/WebFrame.h » ('j') | public/web/WebFrameClient.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698