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

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

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Back out non-Oilpan experiment + tidy up by adding frame() ref accessors Created 6 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) 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 312
313 TEST_F(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) 313 TEST_F(WebViewTest, SetBaseBackgroundColorBeforeMainFrame)
314 { 314 {
315 const WebColor kBlue = 0xFF0000FF; 315 const WebColor kBlue = 0xFF0000FF;
316 FrameTestHelpers::TestWebViewClient webViewClient; 316 FrameTestHelpers::TestWebViewClient webViewClient;
317 WebView* webView = WebViewImpl::create(&webViewClient); 317 WebView* webView = WebViewImpl::create(&webViewClient);
318 EXPECT_NE(kBlue, webView->backgroundColor()); 318 EXPECT_NE(kBlue, webView->backgroundColor());
319 // webView does not have a frame yet, but we should still be able to set the background color. 319 // webView does not have a frame yet, but we should still be able to set the background color.
320 webView->setBaseBackgroundColor(kBlue); 320 webView->setBaseBackgroundColor(kBlue);
321 EXPECT_EQ(kBlue, webView->backgroundColor()); 321 EXPECT_EQ(kBlue, webView->backgroundColor());
322 webView->setMainFrame(WebLocalFrameImpl::create(0)); 322 WebLocalFrameImpl* frame = WebLocalFrameImpl::create(0);
323 webView->setMainFrame(frame);
323 webView->close(); 324 webView->close();
325 frame->close();
324 } 326 }
325 327
326 TEST_F(WebViewTest, SetBaseBackgroundColorAndBlendWithExistingContent) 328 TEST_F(WebViewTest, SetBaseBackgroundColorAndBlendWithExistingContent)
327 { 329 {
328 const WebColor kAlphaRed = 0x80FF0000; 330 const WebColor kAlphaRed = 0x80FF0000;
329 const WebColor kAlphaGreen = 0x8000FF00; 331 const WebColor kAlphaGreen = 0x8000FF00;
330 const int kWidth = 100; 332 const int kWidth = 100;
331 const int kHeight = 100; 333 const int kHeight = 100;
332 334
333 WebView* webView = m_webViewHelper.initialize(); 335 WebView* webView = m_webViewHelper.initialize();
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 loadFrame(webView->mainFrame(), url); 2215 loadFrame(webView->mainFrame(), url);
2214 2216
2215 FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame View(); 2217 FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame View();
2216 2218
2217 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T his EXPECT is 2219 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T his EXPECT is
2218 // merely a dummy. The real test is that we don't trigger asserts in debug b uilds. 2220 // merely a dummy. The real test is that we don't trigger asserts in debug b uilds.
2219 EXPECT_FALSE(frameView->needsLayout()); 2221 EXPECT_FALSE(frameView->needsLayout());
2220 }; 2222 };
2221 2223
2222 } // namespace 2224 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698