| Index: Source/core/html/HTMLLinkElementSizesAttributeTest.cpp
|
| diff --git a/Source/web/tests/WebUserGestureTokenTest.cpp b/Source/core/html/HTMLLinkElementSizesAttributeTest.cpp
|
| similarity index 55%
|
| copy from Source/web/tests/WebUserGestureTokenTest.cpp
|
| copy to Source/core/html/HTMLLinkElementSizesAttributeTest.cpp
|
| index 0c39c39f1130759e29d2a3a4772e4a35a831a178..e9a0ea844ee6f1360602c788b4295c9ef89d4c90 100644
|
| --- a/Source/web/tests/WebUserGestureTokenTest.cpp
|
| +++ b/Source/core/html/HTMLLinkElementSizesAttributeTest.cpp
|
| @@ -1,5 +1,5 @@
|
| /*
|
| - * Copyright (C) 2013 Google Inc. All rights reserved.
|
| + * Copyright 2014, Google Inc. All rights reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| * modification, are permitted provided that the following conditions are
|
| @@ -29,51 +29,51 @@
|
| */
|
|
|
| #include "config.h"
|
| -
|
| -#include "WebUserGestureToken.h"
|
| +#include "core/html/HTMLLinkElement.h"
|
|
|
| #include <gtest/gtest.h>
|
| -#include "WebScopedUserGesture.h"
|
| -#include "WebUserGestureIndicator.h"
|
| -#include "platform/UserGestureIndicator.h"
|
|
|
| -using namespace blink;
|
| using namespace WebCore;
|
|
|
| namespace {
|
|
|
| -TEST(WebUserGestureTokenTest, Basic)
|
| -{
|
| - WebUserGestureToken token;
|
| - EXPECT_FALSE(token.hasGestures());
|
| -
|
| - {
|
| - WebScopedUserGesture indicator(token);
|
| - EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture());
|
| - }
|
| +class HTMLLinkElementSizesAttributeTest : public testing::Test {
|
| +};
|
|
|
| - {
|
| - UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture);
|
| - EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture());
|
| - token = WebUserGestureIndicator::currentUserGestureToken();
|
| - }
|
| +TEST(HTMLLinkElementSizesAttributeTest, parseSizes)
|
| +{
|
| + AtomicString sizesAttribute = "32x33";
|
| + Vector<IntSize> sizes;
|
| + HTMLLinkElement::parseSizesAttribute(sizesAttribute, &sizes);
|
| + ASSERT_EQ(1U, sizes.size());
|
| + EXPECT_EQ(32, sizes[0].width());
|
| + EXPECT_EQ(33, sizes[0].height());
|
|
|
| - EXPECT_TRUE(token.hasGestures());
|
| - EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture());
|
| + sizesAttribute = "32x33 16x17 128x129";
|
| + sizes.clear();
|
| + HTMLLinkElement::parseSizesAttribute(sizesAttribute, &sizes);
|
| + ASSERT_EQ(3U, sizes.size());
|
| + EXPECT_EQ(32, sizes[0].width());
|
| + EXPECT_EQ(33, sizes[0].height());
|
| + EXPECT_EQ(16, sizes[1].width());
|
| + EXPECT_EQ(17, sizes[1].height());
|
| + EXPECT_EQ(128, sizes[2].width());
|
| + EXPECT_EQ(129, sizes[2].height());
|
|
|
| - {
|
| - WebScopedUserGesture indicator(token);
|
| - EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture());
|
| - WebUserGestureIndicator::consumeUserGesture();
|
| - EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture());
|
| - }
|
| + sizesAttribute = "any";
|
| + sizes.clear();
|
| + HTMLLinkElement::parseSizesAttribute(sizesAttribute, &sizes);
|
| + ASSERT_EQ(0U, sizes.size());
|
|
|
| - EXPECT_FALSE(token.hasGestures());
|
| + sizesAttribute = "32x33 32";
|
| + sizes.clear();
|
| + HTMLLinkElement::parseSizesAttribute(sizesAttribute, &sizes);
|
| + ASSERT_EQ(0U, sizes.size());
|
|
|
| - {
|
| - WebScopedUserGesture indicator(token);
|
| - EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture());
|
| - }
|
| + sizesAttribute = "32x33 any";
|
| + sizes.clear();
|
| + HTMLLinkElement::parseSizesAttribute(sizesAttribute, &sizes);
|
| + ASSERT_EQ(0U, sizes.size());
|
| }
|
|
|
| -}
|
| +} // namespace
|
|
|