Chromium Code Reviews| 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 3185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3196 | 3196 |
| 3197 FrameTestHelpers::WebViewHelper webViewHelper; | 3197 FrameTestHelpers::WebViewHelper webViewHelper; |
| 3198 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-7.ht ml", true, &webFrameClient, 0, setViewportSettings); | 3198 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-7.ht ml", true, &webFrameClient, 0, setViewportSettings); |
| 3199 | 3199 |
| 3200 Page* page = webViewHelper.webViewImpl()->page(); | 3200 Page* page = webViewHelper.webViewImpl()->page(); |
| 3201 runViewportTest(page, 320, 352); | 3201 runViewportTest(page, 320, 352); |
| 3202 | 3202 |
| 3203 EXPECT_EQ(0U, webFrameClient.messages.size()); | 3203 EXPECT_EQ(0U, webFrameClient.messages.size()); |
| 3204 } | 3204 } |
| 3205 | 3205 |
| 3206 TEST_F(ViewportTest, viewportWarnings8) | |
| 3207 { | |
| 3208 ConsoleMessageWebFrameClient webFrameClient; | |
| 3209 | |
| 3210 registerMockedHttpURLLoad("viewport/viewport-warnings-8.html"); | |
| 3211 | |
| 3212 FrameTestHelpers::WebViewHelper webViewHelper; | |
| 3213 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-8.ht ml", true, &webFrameClient, 0, setViewportSettings); | |
| 3214 | |
| 3215 Page* page = webViewHelper.webViewImpl()->page(); | |
| 3216 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | |
| 3217 | |
| 3218 EXPECT_EQ(1U, webFrameClient.messages.size()); | |
| 3219 EXPECT_EQ(WebConsoleMessage::LevelWarning, webFrameClient.messages[0].level) ; | |
| 3220 // 123 followed by a lowercase i and U+0307 (COMBINING DOT ABOVE). | |
| 3221 EXPECT_STREQ("The value \"123i̇\" for key \"width\" was truncated to its num eric prefix.", | |
|
kenneth.christiansen
2014/06/20 14:51:51
Notice that this is not an i, but an i with a dot
| |
| 3222 webFrameClient.messages[0].text.utf8().c_str()); | |
| 3223 | |
| 3224 EXPECT_NEAR(123.0f, constraints.layoutSize.width(), 0.01); | |
| 3225 EXPECT_NEAR(135.3f, constraints.layoutSize.height(), 0.01); | |
| 3226 EXPECT_NEAR(2.60f, constraints.initialScale, 0.01f); | |
| 3227 EXPECT_NEAR(2.60f, constraints.minimumScale, 0.01f); | |
| 3228 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | |
| 3229 EXPECT_TRUE(page->viewportDescription().userZoom); | |
| 3230 } | |
| 3231 | |
| 3206 } // namespace | 3232 } // namespace |
| OLD | NEW |