| OLD | NEW |
| 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 2864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2875 Page* page = web_view_helper.WebView()->GetPage(); | 2875 Page* page = web_view_helper.WebView()->GetPage(); |
| 2876 PageScaleConstraints constraints = RunViewportTest(page, 320, 352); | 2876 PageScaleConstraints constraints = RunViewportTest(page, 320, 352); |
| 2877 | 2877 |
| 2878 EXPECT_EQ(320, constraints.layout_size.Width()); | 2878 EXPECT_EQ(320, constraints.layout_size.Width()); |
| 2879 EXPECT_EQ(352, constraints.layout_size.Height()); | 2879 EXPECT_EQ(352, constraints.layout_size.Height()); |
| 2880 EXPECT_NEAR(1.0f, constraints.initial_scale, 0.01f); | 2880 EXPECT_NEAR(1.0f, constraints.initial_scale, 0.01f); |
| 2881 EXPECT_NEAR(1.0f, constraints.minimum_scale, 0.01f); | 2881 EXPECT_NEAR(1.0f, constraints.minimum_scale, 0.01f); |
| 2882 EXPECT_NEAR(5.0f, constraints.maximum_scale, 0.01f); | 2882 EXPECT_NEAR(5.0f, constraints.maximum_scale, 0.01f); |
| 2883 EXPECT_TRUE(page->GetViewportDescription().user_zoom); | 2883 EXPECT_TRUE(page->GetViewportDescription().user_zoom); |
| 2884 | 2884 |
| 2885 ExecuteScript(web_view_helper.WebView()->MainFrameImpl(), | 2885 ExecuteScript(web_view_helper.LocalMainFrame(), |
| 2886 "originalDoctype = document.doctype;" | 2886 "originalDoctype = document.doctype;" |
| 2887 "document.removeChild(originalDoctype);"); | 2887 "document.removeChild(originalDoctype);"); |
| 2888 | 2888 |
| 2889 constraints = RunViewportTest(page, 320, 352); | 2889 constraints = RunViewportTest(page, 320, 352); |
| 2890 | 2890 |
| 2891 EXPECT_EQ(320, constraints.layout_size.Width()); | 2891 EXPECT_EQ(320, constraints.layout_size.Width()); |
| 2892 EXPECT_EQ(352, constraints.layout_size.Height()); | 2892 EXPECT_EQ(352, constraints.layout_size.Height()); |
| 2893 EXPECT_NEAR(1.0f, constraints.initial_scale, 0.01f); | 2893 EXPECT_NEAR(1.0f, constraints.initial_scale, 0.01f); |
| 2894 EXPECT_NEAR(1.0f, constraints.minimum_scale, 0.01f); | 2894 EXPECT_NEAR(1.0f, constraints.minimum_scale, 0.01f); |
| 2895 EXPECT_NEAR(5.0f, constraints.maximum_scale, 0.01f); | 2895 EXPECT_NEAR(5.0f, constraints.maximum_scale, 0.01f); |
| 2896 EXPECT_TRUE(page->GetViewportDescription().user_zoom); | 2896 EXPECT_TRUE(page->GetViewportDescription().user_zoom); |
| 2897 | 2897 |
| 2898 ExecuteScript(web_view_helper.WebView()->MainFrameImpl(), | 2898 ExecuteScript(web_view_helper.LocalMainFrame(), |
| 2899 "document.insertBefore(originalDoctype, document.firstChild);"); | 2899 "document.insertBefore(originalDoctype, document.firstChild);"); |
| 2900 | 2900 |
| 2901 constraints = RunViewportTest(page, 320, 352); | 2901 constraints = RunViewportTest(page, 320, 352); |
| 2902 | 2902 |
| 2903 EXPECT_EQ(320, constraints.layout_size.Width()); | 2903 EXPECT_EQ(320, constraints.layout_size.Width()); |
| 2904 EXPECT_EQ(352, constraints.layout_size.Height()); | 2904 EXPECT_EQ(352, constraints.layout_size.Height()); |
| 2905 EXPECT_NEAR(1.0f, constraints.initial_scale, 0.01f); | 2905 EXPECT_NEAR(1.0f, constraints.initial_scale, 0.01f); |
| 2906 EXPECT_NEAR(1.0f, constraints.minimum_scale, 0.01f); | 2906 EXPECT_NEAR(1.0f, constraints.minimum_scale, 0.01f); |
| 2907 EXPECT_NEAR(5.0f, constraints.maximum_scale, 0.01f); | 2907 EXPECT_NEAR(5.0f, constraints.maximum_scale, 0.01f); |
| 2908 EXPECT_TRUE(page->GetViewportDescription().user_zoom); | 2908 EXPECT_TRUE(page->GetViewportDescription().user_zoom); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3213 base_url_ + "viewport/viewport-warnings-7.html", &web_frame_client, | 3213 base_url_ + "viewport/viewport-warnings-7.html", &web_frame_client, |
| 3214 nullptr, nullptr, SetViewportSettings); | 3214 nullptr, nullptr, SetViewportSettings); |
| 3215 | 3215 |
| 3216 Page* page = web_view_helper.WebView()->GetPage(); | 3216 Page* page = web_view_helper.WebView()->GetPage(); |
| 3217 RunViewportTest(page, 320, 352); | 3217 RunViewportTest(page, 320, 352); |
| 3218 | 3218 |
| 3219 EXPECT_EQ(0U, web_frame_client.messages.size()); | 3219 EXPECT_EQ(0U, web_frame_client.messages.size()); |
| 3220 } | 3220 } |
| 3221 | 3221 |
| 3222 } // namespace blink | 3222 } // namespace blink |
| OLD | NEW |