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

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

Issue 215533004: Revert of Make start/stop loading notifications per-frame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « Source/web/FrameLoaderClientImpl.cpp ('k') | public/web/WebFrameClient.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5024 matching lines...) Expand 10 before | Expand all | Expand 10 after
5035 ASSERT_FALSE(image.isNull()); 5035 ASSERT_FALSE(image.isNull());
5036 EXPECT_EQ(image.size().width, 10); 5036 EXPECT_EQ(image.size().width, 10);
5037 EXPECT_EQ(image.size().height, 10); 5037 EXPECT_EQ(image.size().height, 10);
5038 // FIXME: The rest of this test is disabled since the ImageDecodeCache state may be inconsistent when this test runs. 5038 // FIXME: The rest of this test is disabled since the ImageDecodeCache state may be inconsistent when this test runs.
5039 // crbug.com/266088 5039 // crbug.com/266088
5040 // SkBitmap bitmap = image.getSkBitmap(); 5040 // SkBitmap bitmap = image.getSkBitmap();
5041 // SkAutoLockPixels locker(bitmap); 5041 // SkAutoLockPixels locker(bitmap);
5042 // EXPECT_EQ(bitmap.getColor(0, 0), SK_ColorBLUE); 5042 // EXPECT_EQ(bitmap.getColor(0, 0), SK_ColorBLUE);
5043 } 5043 }
5044 5044
5045 class TestStartStopCallbackWebFrameClient : public WebFrameClient { 5045 class TestStartStopCallbackWebViewClient : public WebViewClient {
5046 public: 5046 public:
5047 TestStartStopCallbackWebFrameClient() 5047 TestStartStopCallbackWebViewClient()
5048 : m_startLoadingCount(0) 5048 : m_startLoadingCount(0)
5049 , m_stopLoadingCount(0) 5049 , m_stopLoadingCount(0)
5050 , m_differentDocumentStartCount(0) 5050 , m_differentDocumentStartCount(0)
5051 { 5051 {
5052 } 5052 }
5053 5053
5054 virtual void didStartLoading(bool toDifferentDocument) OVERRIDE 5054 virtual void didStartLoading(bool toDifferentDocument) OVERRIDE
5055 { 5055 {
5056 m_startLoadingCount++; 5056 m_startLoadingCount++;
5057 if (toDifferentDocument) 5057 if (toDifferentDocument)
(...skipping 11 matching lines...) Expand all
5069 5069
5070 private: 5070 private:
5071 int m_startLoadingCount; 5071 int m_startLoadingCount;
5072 int m_stopLoadingCount; 5072 int m_stopLoadingCount;
5073 int m_differentDocumentStartCount; 5073 int m_differentDocumentStartCount;
5074 }; 5074 };
5075 5075
5076 TEST_F(WebFrameTest, PushStateStartsAndStops) 5076 TEST_F(WebFrameTest, PushStateStartsAndStops)
5077 { 5077 {
5078 registerMockedHttpURLLoad("push_state.html"); 5078 registerMockedHttpURLLoad("push_state.html");
5079 TestStartStopCallbackWebFrameClient client; 5079 TestStartStopCallbackWebViewClient client;
5080 FrameTestHelpers::WebViewHelper webViewHelper; 5080 FrameTestHelpers::WebViewHelper webViewHelper;
5081 webViewHelper.initializeAndLoad(m_baseURL + "push_state.html", true, &client ); 5081 webViewHelper.initializeAndLoad(m_baseURL + "push_state.html", true, 0, &cli ent);
5082 runPendingTasks(); 5082 runPendingTasks();
5083 5083
5084 EXPECT_EQ(client.startLoadingCount(), 2); 5084 EXPECT_EQ(client.startLoadingCount(), 2);
5085 EXPECT_EQ(client.stopLoadingCount(), 2); 5085 EXPECT_EQ(client.stopLoadingCount(), 2);
5086 EXPECT_EQ(client.differentDocumentStartCount(), 1); 5086 EXPECT_EQ(client.differentDocumentStartCount(), 1);
5087 } 5087 }
5088 5088
5089 class TestHistoryWebFrameClient : public WebFrameClient { 5089 class TestHistoryWebFrameClient : public WebFrameClient {
5090 public: 5090 public:
5091 TestHistoryWebFrameClient() 5091 TestHistoryWebFrameClient()
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
5390 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); 5390 EXPECT_EQ(2U, container->percentHeightDescendants()->size());
5391 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA nonymous)); 5391 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA nonymous));
5392 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir ectChild)); 5392 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir ectChild));
5393 5393
5394 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB lock(); 5394 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB lock();
5395 EXPECT_TRUE(anonymousBlock->isAnonymous()); 5395 EXPECT_TRUE(anonymousBlock->isAnonymous());
5396 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); 5396 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants());
5397 } 5397 }
5398 5398
5399 } // namespace 5399 } // namespace
OLDNEW
« no previous file with comments | « Source/web/FrameLoaderClientImpl.cpp ('k') | public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698