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

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

Issue 317493002: Change FrameTree to return Frames instead of LocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: dcheng's comment addressed Created 6 years, 6 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 | « Source/web/WebViewImpl.cpp ('k') | 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 /* 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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 webViewHelper.initializeAndLoad(m_baseURL + "iframe_reload.html", true, 0, & client, enableViewportSettings); 753 webViewHelper.initializeAndLoad(m_baseURL + "iframe_reload.html", true, 0, & client, enableViewportSettings);
754 754
755 WebCore::LocalFrame* mainFrame = webViewHelper.webViewImpl()->page()->mainFr ame(); 755 WebCore::LocalFrame* mainFrame = webViewHelper.webViewImpl()->page()->mainFr ame();
756 WebCore::Document* document = mainFrame->document(); 756 WebCore::Document* document = mainFrame->document();
757 WebCore::FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl() ->frameView(); 757 WebCore::FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl() ->frameView();
758 document->settings()->setTextAutosizingEnabled(true); 758 document->settings()->setTextAutosizingEnabled(true);
759 EXPECT_TRUE(document->settings()->textAutosizingEnabled()); 759 EXPECT_TRUE(document->settings()->textAutosizingEnabled());
760 webViewHelper.webViewImpl()->resize(WebSize(viewportWidth, viewportHeight)); 760 webViewHelper.webViewImpl()->resize(WebSize(viewportWidth, viewportHeight));
761 webViewHelper.webViewImpl()->layout(); 761 webViewHelper.webViewImpl()->layout();
762 762
763 for (WebCore::LocalFrame* frame = mainFrame; frame; frame = frame->tree().tr averseNext()) { 763 for (WebCore::Frame* frame = mainFrame; frame; frame = frame->tree().travers eNext()) {
764 EXPECT_TRUE(setTextAutosizingMultiplier(frame->document(), 2)); 764 if (!frame->isLocalFrame())
765 for (WebCore::RenderObject* renderer = frame->document()->renderView(); renderer; renderer = renderer->nextInPreOrder()) { 765 continue;
766 EXPECT_TRUE(setTextAutosizingMultiplier(toLocalFrame(frame)->document(), 2));
767 for (WebCore::RenderObject* renderer = toLocalFrame(frame)->document()-> renderView(); renderer; renderer = renderer->nextInPreOrder()) {
766 if (renderer->isText()) 768 if (renderer->isText())
767 EXPECT_FALSE(renderer->needsLayout()); 769 EXPECT_FALSE(renderer->needsLayout());
768 } 770 }
769 } 771 }
770 772
771 frameView->setFrameRect(WebCore::IntRect(0, 0, 200, 200)); 773 frameView->setFrameRect(WebCore::IntRect(0, 0, 200, 200));
772 for (WebCore::LocalFrame* frame = mainFrame; frame; frame = frame->tree().tr averseNext()) { 774 for (WebCore::Frame* frame = mainFrame; frame; frame = frame->tree().travers eNext()) {
773 for (WebCore::RenderObject* renderer = frame->document()->renderView(); renderer; renderer = renderer->nextInPreOrder()) { 775 if (!frame->isLocalFrame())
776 continue;
777 for (WebCore::RenderObject* renderer = toLocalFrame(frame)->document()-> renderView(); renderer; renderer = renderer->nextInPreOrder()) {
774 if (renderer->isText()) 778 if (renderer->isText())
775 EXPECT_TRUE(renderer->needsLayout()); 779 EXPECT_TRUE(renderer->needsLayout());
776 } 780 }
777 } 781 }
778 } 782 }
779 783
780 TEST_F(WebFrameTest, FixedLayoutSizeStopsResizeFromChangingLayoutSize) 784 TEST_F(WebFrameTest, FixedLayoutSizeStopsResizeFromChangingLayoutSize)
781 { 785 {
782 UseMockScrollbarSettings mockScrollbarSettings; 786 UseMockScrollbarSettings mockScrollbarSettings;
783 registerMockedHttpURLLoad("fixed_layout.html"); 787 registerMockedHttpURLLoad("fixed_layout.html");
(...skipping 4750 matching lines...) Expand 10 before | Expand all | Expand 10 after
5534 canvas.drawColor(SK_ColorGREEN); 5538 canvas.drawColor(SK_ColorGREEN);
5535 5539
5536 EXPECT_EQ(20, dragImage->size().width()); 5540 EXPECT_EQ(20, dragImage->size().width());
5537 EXPECT_EQ(40, dragImage->size().height()); 5541 EXPECT_EQ(40, dragImage->size().height());
5538 const SkBitmap& dragBitmap = dragImage->bitmap(); 5542 const SkBitmap& dragBitmap = dragImage->bitmap();
5539 SkAutoLockPixels lockPixel(dragBitmap); 5543 SkAutoLockPixels lockPixel(dragBitmap);
5540 EXPECT_EQ(0, memcmp(bitmap.getPixels(), dragBitmap.getPixels(), bitmap.getSi ze())); 5544 EXPECT_EQ(0, memcmp(bitmap.getPixels(), dragBitmap.getPixels(), bitmap.getSi ze()));
5541 } 5545 }
5542 5546
5543 } // namespace 5547 } // namespace
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698