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

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

Issue 416173003: Merge 176713 "Uptake http://trac.webkit.org/changeset/169848" (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2062/
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 2511 matching lines...) Expand 10 before | Expand all | Expand 10 after
2522 PageScaleConstraints constraints = runViewportTest(page, 320, 352); 2522 PageScaleConstraints constraints = runViewportTest(page, 320, 352);
2523 2523
2524 EXPECT_EQ(980, constraints.layoutSize.width()); 2524 EXPECT_EQ(980, constraints.layoutSize.width());
2525 EXPECT_EQ(1078, constraints.layoutSize.height()); 2525 EXPECT_EQ(1078, constraints.layoutSize.height());
2526 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); 2526 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f);
2527 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); 2527 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f);
2528 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); 2528 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f);
2529 EXPECT_TRUE(page->viewportDescription().userZoom); 2529 EXPECT_TRUE(page->viewportDescription().userZoom);
2530 } 2530 }
2531 2531
2532 TEST_F(ViewportTest, viewport138)
2533 {
2534 registerMockedHttpURLLoad("viewport/viewport-138.html");
2535
2536 FrameTestHelpers::WebViewHelper webViewHelper;
2537 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-138.html", tr ue, 0, 0, setViewportSettings);
2538
2539 Page* page = webViewHelper.webViewImpl()->page();
2540 PageScaleConstraints constraints = runViewportTest(page, 320, 352);
2541
2542 EXPECT_NEAR(123.0f, constraints.layoutSize.width(), 0.01);
2543 EXPECT_NEAR(135.3f, constraints.layoutSize.height(), 0.01);
2544 EXPECT_NEAR(2.60f, constraints.initialScale, 0.01f);
2545 EXPECT_NEAR(2.60f, constraints.minimumScale, 0.01f);
2546 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f);
2547 EXPECT_TRUE(page->viewportDescription().userZoom);
2548 }
2549
2532 TEST_F(ViewportTest, viewportLegacyHandheldFriendly) 2550 TEST_F(ViewportTest, viewportLegacyHandheldFriendly)
2533 { 2551 {
2534 UseMockScrollbarSettings mockScrollbarSettings; 2552 UseMockScrollbarSettings mockScrollbarSettings;
2535 registerMockedHttpURLLoad("viewport/viewport-legacy-handheldfriendly.html"); 2553 registerMockedHttpURLLoad("viewport/viewport-legacy-handheldfriendly.html");
2536 2554
2537 FrameTestHelpers::WebViewHelper webViewHelper; 2555 FrameTestHelpers::WebViewHelper webViewHelper;
2538 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-handhe ldfriendly.html", true, 0, 0, setViewportSettings); 2556 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-handhe ldfriendly.html", true, 0, 0, setViewportSettings);
2539 2557
2540 Page* page = webViewHelper.webViewImpl()->page(); 2558 Page* page = webViewHelper.webViewImpl()->page();
2541 PageScaleConstraints constraints = runViewportTest(page, 320, 352); 2559 PageScaleConstraints constraints = runViewportTest(page, 320, 352);
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
3197 FrameTestHelpers::WebViewHelper webViewHelper; 3215 FrameTestHelpers::WebViewHelper webViewHelper;
3198 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-7.ht ml", true, &webFrameClient, 0, setViewportSettings); 3216 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-7.ht ml", true, &webFrameClient, 0, setViewportSettings);
3199 3217
3200 Page* page = webViewHelper.webViewImpl()->page(); 3218 Page* page = webViewHelper.webViewImpl()->page();
3201 runViewportTest(page, 320, 352); 3219 runViewportTest(page, 320, 352);
3202 3220
3203 EXPECT_EQ(0U, webFrameClient.messages.size()); 3221 EXPECT_EQ(0U, webFrameClient.messages.size());
3204 } 3222 }
3205 3223
3206 } // namespace 3224 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMetaElement-in.cpp ('k') | Source/web/tests/data/viewport/viewport-138.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698