本文整理汇总了C++中HTMLLinkElement::fastHasAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLLinkElement::fastHasAttribute方法的具体用法?C++ HTMLLinkElement::fastHasAttribute怎么用?C++ HTMLLinkElement::fastHasAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLLinkElement
的用法示例。
在下文中一共展示了HTMLLinkElement::fastHasAttribute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadURL
TEST_F(WebDocumentTest, ManifestUseCredentials)
{
loadURL(std::string(kDefaultOrigin) + kManifestDummyFilePath);
WebDocument webDoc = topWebDocument();
Document* document = topDocument();
HTMLLinkElement* linkManifest = document->linkManifest();
// No crossorigin attribute was set so credentials shouldn't be used.
ASSERT_FALSE(linkManifest->fastHasAttribute(HTMLNames::crossoriginAttr));
ASSERT_FALSE(webDoc.manifestUseCredentials());
// Crossorigin set to a random string shouldn't trigger using credentials.
linkManifest->setAttribute(HTMLNames::crossoriginAttr, "foobar");
ASSERT_FALSE(webDoc.manifestUseCredentials());
// Crossorigin set to 'anonymous' shouldn't trigger using credentials.
linkManifest->setAttribute(HTMLNames::crossoriginAttr, "anonymous");
ASSERT_FALSE(webDoc.manifestUseCredentials());
// Crossorigin set to 'use-credentials' should trigger using credentials.
linkManifest->setAttribute(HTMLNames::crossoriginAttr, "use-credentials");
ASSERT_TRUE(webDoc.manifestUseCredentials());
}