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

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

Issue 2953193002: Move ContentsSize and HasVisibleContent methods from WebFrame to WebLocalFrame. (Closed)
Patch Set: . Created 3 years, 5 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 8489 matching lines...) Expand 10 before | Expand all | Expand 10 after
8500 EXPECT_FALSE(anonymous_block->HasPercentHeightDescendants()); 8500 EXPECT_FALSE(anonymous_block->HasPercentHeightDescendants());
8501 } 8501 }
8502 8502
8503 TEST_P(ParameterizedWebFrameTest, HasVisibleContentOnVisibleFrames) { 8503 TEST_P(ParameterizedWebFrameTest, HasVisibleContentOnVisibleFrames) {
8504 RegisterMockedHttpURLLoad("visible_frames.html"); 8504 RegisterMockedHttpURLLoad("visible_frames.html");
8505 FrameTestHelpers::WebViewHelper web_view_helper; 8505 FrameTestHelpers::WebViewHelper web_view_helper;
8506 WebViewBase* web_view_impl = 8506 WebViewBase* web_view_impl =
8507 web_view_helper.InitializeAndLoad(base_url_ + "visible_frames.html"); 8507 web_view_helper.InitializeAndLoad(base_url_ + "visible_frames.html");
8508 for (WebFrame* frame = web_view_impl->MainFrameImpl()->TraverseNext(); frame; 8508 for (WebFrame* frame = web_view_impl->MainFrameImpl()->TraverseNext(); frame;
8509 frame = frame->TraverseNext()) { 8509 frame = frame->TraverseNext()) {
8510 EXPECT_TRUE(frame->HasVisibleContent()); 8510 EXPECT_TRUE(frame->ToWebLocalFrame()->HasVisibleContent());
8511 } 8511 }
8512 } 8512 }
8513 8513
8514 TEST_P(ParameterizedWebFrameTest, HasVisibleContentOnHiddenFrames) { 8514 TEST_P(ParameterizedWebFrameTest, HasVisibleContentOnHiddenFrames) {
8515 RegisterMockedHttpURLLoad("hidden_frames.html"); 8515 RegisterMockedHttpURLLoad("hidden_frames.html");
8516 FrameTestHelpers::WebViewHelper web_view_helper; 8516 FrameTestHelpers::WebViewHelper web_view_helper;
8517 WebViewBase* web_view_impl = 8517 WebViewBase* web_view_impl =
8518 web_view_helper.InitializeAndLoad(base_url_ + "hidden_frames.html"); 8518 web_view_helper.InitializeAndLoad(base_url_ + "hidden_frames.html");
8519 for (WebFrame* frame = web_view_impl->MainFrameImpl()->TraverseNext(); frame; 8519 for (WebFrame* frame = web_view_impl->MainFrameImpl()->TraverseNext(); frame;
8520 frame = frame->TraverseNext()) { 8520 frame = frame->TraverseNext()) {
8521 EXPECT_FALSE(frame->HasVisibleContent()); 8521 EXPECT_FALSE(frame->ToWebLocalFrame()->HasVisibleContent());
8522 } 8522 }
8523 } 8523 }
8524 8524
8525 class ManifestChangeWebFrameClient 8525 class ManifestChangeWebFrameClient
8526 : public FrameTestHelpers::TestWebFrameClient { 8526 : public FrameTestHelpers::TestWebFrameClient {
8527 public: 8527 public:
8528 ManifestChangeWebFrameClient() : manifest_change_count_(0) {} 8528 ManifestChangeWebFrameClient() : manifest_change_count_(0) {}
8529 void DidChangeManifest() override { ++manifest_change_count_; } 8529 void DidChangeManifest() override { ++manifest_change_count_; }
8530 8530
8531 int ManifestChangeCount() { return manifest_change_count_; } 8531 int ManifestChangeCount() { return manifest_change_count_; }
(...skipping 3478 matching lines...) Expand 10 before | Expand all | Expand 10 after
12010 if (obj->IsText()) { 12010 if (obj->IsText()) {
12011 LayoutText* layout_text = ToLayoutText(obj); 12011 LayoutText* layout_text = ToLayoutText(obj);
12012 text = layout_text->GetText(); 12012 text = layout_text->GetText();
12013 break; 12013 break;
12014 } 12014 }
12015 } 12015 }
12016 EXPECT_EQ("foo alt", text.Utf8()); 12016 EXPECT_EQ("foo alt", text.Utf8());
12017 } 12017 }
12018 12018
12019 } // namespace blink 12019 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698