OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 #include "third_party/skia/include/core/SkBitmapDevice.h" | 75 #include "third_party/skia/include/core/SkBitmapDevice.h" |
76 #include "third_party/skia/include/core/SkCanvas.h" | 76 #include "third_party/skia/include/core/SkCanvas.h" |
77 #include "web/WebLocalFrameImpl.h" | 77 #include "web/WebLocalFrameImpl.h" |
78 #include "web/WebSettingsImpl.h" | 78 #include "web/WebSettingsImpl.h" |
79 #include "web/WebViewImpl.h" | 79 #include "web/WebViewImpl.h" |
80 #include "web/tests/FrameTestHelpers.h" | 80 #include "web/tests/FrameTestHelpers.h" |
81 #include "web/tests/URLTestHelpers.h" | 81 #include "web/tests/URLTestHelpers.h" |
82 #include <gtest/gtest.h> | 82 #include <gtest/gtest.h> |
83 | 83 |
84 using namespace blink; | 84 using namespace blink; |
85 using blink::FrameTestHelpers::loadFrame; | |
85 using blink::FrameTestHelpers::runPendingTasks; | 86 using blink::FrameTestHelpers::runPendingTasks; |
86 using blink::URLTestHelpers::toKURL; | 87 using blink::URLTestHelpers::toKURL; |
87 | 88 |
88 namespace { | 89 namespace { |
89 | 90 |
90 enum HorizontalScrollbarState { | 91 enum HorizontalScrollbarState { |
91 NoHorizontalScrollbar, | 92 NoHorizontalScrollbar, |
92 VisibleHorizontalScrollbar, | 93 VisibleHorizontalScrollbar, |
93 }; | 94 }; |
94 | 95 |
(...skipping 2053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2148 | 2149 |
2149 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); | 2150 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); |
2150 frame->executeScript(WebScriptSource(WebString::fromUTF8("document.execComma nd('SelectAll', false, null)"))); | 2151 frame->executeScript(WebScriptSource(WebString::fromUTF8("document.execComma nd('SelectAll', false, null)"))); |
2151 std::string actual = frame->selectionAsText().utf8(); | 2152 std::string actual = frame->selectionAsText().utf8(); |
2152 | 2153 |
2153 const int kMaxOutputCharacters = 1024; | 2154 const int kMaxOutputCharacters = 1024; |
2154 std::string expected = frame->contentAsText(kMaxOutputCharacters).utf8(); | 2155 std::string expected = frame->contentAsText(kMaxOutputCharacters).utf8(); |
2155 EXPECT_EQ(expected, actual); | 2156 EXPECT_EQ(expected, actual); |
2156 } | 2157 } |
2157 | 2158 |
2159 TEST_F(WebViewTest, AutoResizeSubtreeLayout) | |
levin
2014/08/22 02:11:00
If you care about this area, and you seem to, ther
rune
2014/08/22 08:52:26
They pass for me when I enable them locally.
Runn
| |
2160 { | |
2161 std::string url = m_baseURL + "subtree-layout.html"; | |
2162 URLTestHelpers::registerMockedURLLoad(toKURL(url), "subtree-layout.html"); | |
2163 WebView* webView = m_webViewHelper.initialize(true); | |
2164 | |
2165 webView->enableAutoResizeMode(WebSize(200, 200), WebSize(200, 200)); | |
2166 loadFrame(webView->mainFrame(), url); | |
2167 | |
2168 blink::FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl() ->frameView(); | |
2169 | |
2170 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T his EXPECT is | |
2171 // merely a dummy. The real test is that we don't trigger asserts in debug b uilds. | |
2172 EXPECT_FALSE(frameView->needsLayout()); | |
2173 }; | |
2174 | |
2158 } // namespace | 2175 } // namespace |
OLD | NEW |