| 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 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2945 ConsoleMessageWebFrameClient webFrameClient; | 2945 ConsoleMessageWebFrameClient webFrameClient; |
| 2946 | 2946 |
| 2947 registerMockedHttpURLLoad("viewport/viewport-warnings-5.html"); | 2947 registerMockedHttpURLLoad("viewport/viewport-warnings-5.html"); |
| 2948 | 2948 |
| 2949 FrameTestHelpers::WebViewHelper webViewHelper; | 2949 FrameTestHelpers::WebViewHelper webViewHelper; |
| 2950 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-5.ht
ml", true, &webFrameClient, nullptr, nullptr, setViewportSettings); | 2950 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-5.ht
ml", true, &webFrameClient, nullptr, nullptr, setViewportSettings); |
| 2951 | 2951 |
| 2952 Page* page = webViewHelper.webView()->page(); | 2952 Page* page = webViewHelper.webView()->page(); |
| 2953 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2953 PageScaleConstraints constraints = runViewportTest(page, 320, 352); |
| 2954 | 2954 |
| 2955 EXPECT_EQ(5U, webFrameClient.messages.size()); | 2955 EXPECT_EQ(1U, webFrameClient.messages.size()); |
| 2956 | 2956 |
| 2957 EXPECT_EQ(WebConsoleMessage::LevelWarning, webFrameClient.messages[0].level)
; | 2957 EXPECT_EQ(WebConsoleMessage::LevelWarning, webFrameClient.messages[0].level)
; |
| 2958 EXPECT_STREQ("The value \"device-width;\" for key \"width\" is invalid, and
has been ignored.", | 2958 EXPECT_STREQ("Error parsing a meta element's content: ';' is not a valid key
-value pair separator. Please use ',' instead.", |
| 2959 webFrameClient.messages[0].text.utf8().c_str()); | 2959 webFrameClient.messages[0].text.utf8().c_str()); |
| 2960 | 2960 |
| 2961 EXPECT_EQ(WebConsoleMessage::LevelWarning, webFrameClient.messages[1].level)
; | |
| 2962 EXPECT_STREQ("The value \"1.0;\" for key \"initial-scale\" was truncated to
its numeric prefix.", | |
| 2963 webFrameClient.messages[1].text.utf8().c_str()); | |
| 2964 | |
| 2965 EXPECT_EQ(WebConsoleMessage::LevelWarning, webFrameClient.messages[2].level)
; | |
| 2966 EXPECT_STREQ("The value \"1.0;\" for key \"maximum-scale\" was truncated to
its numeric prefix.", | |
| 2967 webFrameClient.messages[2].text.utf8().c_str()); | |
| 2968 | |
| 2969 EXPECT_EQ(WebConsoleMessage::LevelWarning, webFrameClient.messages[3].level)
; | |
| 2970 EXPECT_STREQ("The value \"0;\" for key \"user-scalable\" was truncated to it
s numeric prefix.", | |
| 2971 webFrameClient.messages[3].text.utf8().c_str()); | |
| 2972 | |
| 2973 EXPECT_EQ(WebConsoleMessage::LevelWarning, webFrameClient.messages[4].level)
; | |
| 2974 EXPECT_STREQ("Error parsing a meta element's content: ';' is not a valid key
-value pair separator. Please use ',' instead.", | |
| 2975 webFrameClient.messages[4].text.utf8().c_str()); | |
| 2976 | |
| 2977 EXPECT_NEAR(320.0f, constraints.layoutSize.width(), 0.01); | 2961 EXPECT_NEAR(320.0f, constraints.layoutSize.width(), 0.01); |
| 2978 EXPECT_NEAR(352.0f, constraints.layoutSize.height(), 0.01); | 2962 EXPECT_NEAR(352.0f, constraints.layoutSize.height(), 0.01); |
| 2979 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2963 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
| 2980 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2964 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
| 2981 EXPECT_NEAR(1.0f, constraints.maximumScale, 0.01f); | 2965 EXPECT_NEAR(1.0f, constraints.maximumScale, 0.01f); |
| 2982 EXPECT_FALSE(page->viewportDescription().userZoom); | 2966 EXPECT_FALSE(page->viewportDescription().userZoom); |
| 2983 } | 2967 } |
| 2984 | 2968 |
| 2985 TEST_F(ViewportTest, viewportWarnings6) | 2969 TEST_F(ViewportTest, viewportWarnings6) |
| 2986 { | 2970 { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 3016 FrameTestHelpers::WebViewHelper webViewHelper; | 3000 FrameTestHelpers::WebViewHelper webViewHelper; |
| 3017 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-7.ht
ml", true, &webFrameClient, nullptr, nullptr, setViewportSettings); | 3001 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-7.ht
ml", true, &webFrameClient, nullptr, nullptr, setViewportSettings); |
| 3018 | 3002 |
| 3019 Page* page = webViewHelper.webView()->page(); | 3003 Page* page = webViewHelper.webView()->page(); |
| 3020 runViewportTest(page, 320, 352); | 3004 runViewportTest(page, 320, 352); |
| 3021 | 3005 |
| 3022 EXPECT_EQ(0U, webFrameClient.messages.size()); | 3006 EXPECT_EQ(0U, webFrameClient.messages.size()); |
| 3023 } | 3007 } |
| 3024 | 3008 |
| 3025 } // namespace blink | 3009 } // namespace blink |
| OLD | NEW |