| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 } | 140 } |
| 141 | 141 |
| 142 void registerMockedChromeURLLoad(const std::string& fileName) | 142 void registerMockedChromeURLLoad(const std::string& fileName) |
| 143 { | 143 { |
| 144 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chrom
eURL.c_str()), WebString::fromUTF8(fileName.c_str())); | 144 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chrom
eURL.c_str()), WebString::fromUTF8(fileName.c_str())); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void applyViewportStyleOverride(FrameTestHelpers::WebViewHelper* webViewHelp
er) | 147 void applyViewportStyleOverride(FrameTestHelpers::WebViewHelper* webViewHelp
er) |
| 148 { | 148 { |
| 149 RefPtrWillBeRawPtr<WebCore::StyleSheetContents> styleSheet = WebCore::St
yleSheetContents::create(WebCore::CSSParserContext(WebCore::UASheetMode, 0)); | 149 RefPtrWillBeRawPtr<WebCore::StyleSheetContents> styleSheet = WebCore::St
yleSheetContents::create(WebCore::CSSParserContext(WebCore::UASheetMode, 0)); |
| 150 styleSheet->parseString(String(WebCore::viewportAndroidUserAgentStyleShe
et, sizeof(WebCore::viewportAndroidUserAgentStyleSheet))); | 150 styleSheet->parseString(String(WebCore::viewportAndroidCss, sizeof(WebCo
re::viewportAndroidCss))); |
| 151 OwnPtrWillBeRawPtr<WebCore::RuleSet> ruleSet = WebCore::RuleSet::create(
); | 151 OwnPtrWillBeRawPtr<WebCore::RuleSet> ruleSet = WebCore::RuleSet::create(
); |
| 152 ruleSet->addRulesFromSheet(styleSheet.get(), WebCore::MediaQueryEvaluato
r("screen")); | 152 ruleSet->addRulesFromSheet(styleSheet.get(), WebCore::MediaQueryEvaluato
r("screen")); |
| 153 | 153 |
| 154 Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()->
mainFrame())->document(); | 154 Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()->
mainFrame())->document(); |
| 155 document->ensureStyleResolver().viewportStyleResolver()->collectViewport
Rules(ruleSet.get(), WebCore::ViewportStyleResolver::UserAgentOrigin); | 155 document->ensureStyleResolver().viewportStyleResolver()->collectViewport
Rules(ruleSet.get(), WebCore::ViewportStyleResolver::UserAgentOrigin); |
| 156 document->ensureStyleResolver().viewportStyleResolver()->resolve(); | 156 document->ensureStyleResolver().viewportStyleResolver()->resolve(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 static void configueCompositingWebView(WebSettings* settings) | 159 static void configueCompositingWebView(WebSettings* settings) |
| 160 { | 160 { |
| (...skipping 5446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5607 EXPECT_EQ(0xff0000ff, frame->document().brandColor()); | 5607 EXPECT_EQ(0xff0000ff, frame->document().brandColor()); |
| 5608 // Change of second brand-color meta tag will not change frame's brand | 5608 // Change of second brand-color meta tag will not change frame's brand |
| 5609 // color. | 5609 // color. |
| 5610 client.reset(); | 5610 client.reset(); |
| 5611 frame->executeScript(WebScriptSource("document.getElementById('bc2').setAttr
ibute('content', '#00FF00');")); | 5611 frame->executeScript(WebScriptSource("document.getElementById('bc2').setAttr
ibute('content', '#00FF00');")); |
| 5612 EXPECT_TRUE(client.didNotify()); | 5612 EXPECT_TRUE(client.didNotify()); |
| 5613 EXPECT_EQ(0xff0000ff, frame->document().brandColor()); | 5613 EXPECT_EQ(0xff0000ff, frame->document().brandColor()); |
| 5614 } | 5614 } |
| 5615 | 5615 |
| 5616 } // namespace | 5616 } // namespace |
| OLD | NEW |