Changeset 133916 in webkit


Ignore:
Timestamp:
Nov 8, 2012 10:33:22 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Cleanup IDBBindingUtilitiesTest
https://bugs.webkit.org/show_bug.cgi?id=100860

Patch by Dan Carney <dcarney@google.com> on 2012-11-08
Reviewed by Adam Barth.

Small cleanup of IDBBindingUtilitiesTest as per
https://bugs.webkit.org/show_bug.cgi?id=99975#c38

  • tests/IDBBindingUtilitiesTest.cpp:

(IDBKeyFromValueAndKeyPathTest):
(WebKit::IDBKeyFromValueAndKeyPathTest::IDBKeyFromValueAndKeyPathTest):
(WebKit::IDBKeyFromValueAndKeyPathTest::context):
(WebKit):
(WebKit::TEST_F):

Location:
trunk/Source/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r133910 r133916  
     12012-11-08  Dan Carney  <dcarney@google.com>
     2
     3        Cleanup IDBBindingUtilitiesTest
     4        https://bugs.webkit.org/show_bug.cgi?id=100860
     5
     6        Reviewed by Adam Barth.
     7
     8        Small cleanup of IDBBindingUtilitiesTest as per
     9        https://bugs.webkit.org/show_bug.cgi?id=99975#c38
     10
     11        * tests/IDBBindingUtilitiesTest.cpp:
     12        (IDBKeyFromValueAndKeyPathTest):
     13        (WebKit::IDBKeyFromValueAndKeyPathTest::IDBKeyFromValueAndKeyPathTest):
     14        (WebKit::IDBKeyFromValueAndKeyPathTest::context):
     15        (WebKit):
     16        (WebKit::TEST_F):
     17
    1182012-11-08  Keishi Hattori  <keishi@webkit.org>
    219
  • trunk/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp

    r132922 r133916  
    100100}
    101101
    102 static v8::Handle<v8::Context> context()
    103 {
    104     static WebView* webView;
    105     if (!webView) {
    106         webView = FrameTestHelpers::createWebViewAndLoad("about:blank");
    107         webView->setFocus(true);
    108     }
    109     ScriptExecutionContext* context = static_cast<WebFrameImpl*>(webView->mainFrame())->frame()->document();
    110     return toV8Context(context, WorldContextHandle(UseCurrentWorld));
    111 }
    112 
    113 TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue)
     102class IDBKeyFromValueAndKeyPathTest : public testing::Test {
     103public:
     104    IDBKeyFromValueAndKeyPathTest()
     105        : m_webView(0)
     106    {
     107    }
     108
     109    void SetUp() OVERRIDE
     110    {
     111        m_webView = FrameTestHelpers::createWebViewAndLoad("about:blank");
     112        m_webView->setFocus(true);
     113    }
     114
     115    void TearDown() OVERRIDE
     116    {
     117        m_webView->close();
     118    }
     119
     120    v8::Handle<v8::Context> context()
     121    {
     122        return static_cast<WebFrameImpl*>(m_webView->mainFrame())->frame()->script()->mainWorldContext();
     123    }
     124
     125private:
     126    WebView* m_webView;
     127};
     128
     129TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue)
    114130{
    115131    v8::HandleScope handleScope;
     
    125141}
    126142
    127 TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue)
     143TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue)
    128144{
    129145    v8::HandleScope handleScope;
     
    139155}
    140156
    141 TEST(IDBKeyFromValueAndKeyPathTest, SubProperty)
     157TEST_F(IDBKeyFromValueAndKeyPathTest, SubProperty)
    142158{
    143159    v8::HandleScope handleScope;
     
    155171}
    156172
    157 TEST(InjectIDBKeyTest, TopLevelPropertyStringValue)
     173class InjectIDBKeyTest : public IDBKeyFromValueAndKeyPathTest {
     174};
     175
     176TEST_F(InjectIDBKeyTest, TopLevelPropertyStringValue)
    158177{
    159178    v8::HandleScope handleScope;
     
    170189}
    171190
    172 TEST(InjectIDBKeyTest, SubProperty)
     191TEST_F(InjectIDBKeyTest, SubProperty)
    173192{
    174193    v8::HandleScope handleScope;
Note: See TracChangeset for help on using the changeset viewer.