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

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

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 years 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 | « third_party/WebKit/Source/web/WebPluginContainerImpl.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) 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 SkCanvas canvas(bitmap); 564 SkCanvas canvas(bitmap);
565 canvas.clear(kAlphaRed); 565 canvas.clear(kAlphaRed);
566 566
567 SkPictureBuilder pictureBuilder(FloatRect(0, 0, kWidth, kHeight)); 567 SkPictureBuilder pictureBuilder(FloatRect(0, 0, kWidth, kHeight));
568 568
569 // Paint the root of the main frame in the way that CompositedLayerMapping w ould. 569 // Paint the root of the main frame in the way that CompositedLayerMapping w ould.
570 FrameView* view = m_webViewHelper.webViewImpl()->mainFrameImpl()->frameView( ); 570 FrameView* view = m_webViewHelper.webViewImpl()->mainFrameImpl()->frameView( );
571 PaintLayer* rootLayer = view->layoutView()->layer(); 571 PaintLayer* rootLayer = view->layoutView()->layer();
572 LayoutRect paintRect(0, 0, kWidth, kHeight); 572 LayoutRect paintRect(0, 0, kWidth, kHeight);
573 PaintLayerPaintingInfo paintingInfo(rootLayer, paintRect, GlobalPaintNormalP hase, LayoutSize()); 573 PaintLayerPaintingInfo paintingInfo(rootLayer, paintRect, GlobalPaintNormalP hase, LayoutSize());
574 PaintLayerPainter(*rootLayer).paintLayerContents(&pictureBuilder.context(), paintingInfo, PaintLayerPaintingCompositingAllPhases); 574 PaintLayerPainter(*rootLayer).paintLayerContents(pictureBuilder.context(), p aintingInfo, PaintLayerPaintingCompositingAllPhases);
575 575
576 pictureBuilder.endRecording()->playback(&canvas); 576 pictureBuilder.endRecording()->playback(&canvas);
577 577
578 // The result should be a blend of red and green. 578 // The result should be a blend of red and green.
579 SkColor color = bitmap.getColor(kWidth / 2, kHeight / 2); 579 SkColor color = bitmap.getColor(kWidth / 2, kHeight / 2);
580 EXPECT_TRUE(redChannel(color)); 580 EXPECT_TRUE(redChannel(color));
581 EXPECT_TRUE(greenChannel(color)); 581 EXPECT_TRUE(greenChannel(color));
582 } 582 }
583 583
584 TEST_F(WebViewTest, FocusIsInactive) 584 TEST_F(WebViewTest, FocusIsInactive)
(...skipping 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after
3174 WebFrame* frame = mainWebView.webView()->mainFrame(); 3174 WebFrame* frame = mainWebView.webView()->mainFrame();
3175 v8::HandleScope scope(v8::Isolate::GetCurrent()); 3175 v8::HandleScope scope(v8::Isolate::GetCurrent());
3176 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS ource("var win = window.open('javascript:false'); win.document")); 3176 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS ource("var win = window.open('javascript:false'); win.document"));
3177 ASSERT_TRUE(v8Value->IsObject()); 3177 ASSERT_TRUE(v8Value->IsObject());
3178 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent (), v8Value); 3178 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent (), v8Value);
3179 ASSERT_TRUE(document); 3179 ASSERT_TRUE(document);
3180 EXPECT_FALSE(document->frame()->isLoading()); 3180 EXPECT_FALSE(document->frame()->isLoading());
3181 } 3181 }
3182 3182
3183 } // namespace blink 3183 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebPluginContainerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698