Changeset 161257 in webkit


Ignore:
Timestamp:
Jan 3, 2014 12:45:06 AM (10 years ago)
Author:
jinwoo7.song@samsung.com
Message:

VibrationPattern should allocate an single vector instance for single integer input
https://bugs.webkit.org/show_bug.cgi?id=126417

Reviewed by Gyuyoung Kim.

Source/WebCore:

When the Vibration pattern is set with a single integer, the VibrationPattern should
be set with this integer as a vibration time. But the VibrationPattern(unsigned vector) was
initialized with a single parameter, the vibration time, so the time was used to set
the size of vector.

  • Modules/vibration/NavigatorVibration.cpp:

(WebCore::NavigatorVibration::vibrate):

Source/WebKit2:

Fix a vibration unit test regression after r161139. Also remove unnecessary test cases.

  • UIProcess/API/efl/tests/test_ewk2_view.cpp:

(EWK2ViewTest::loadVibrationHTMLString):
(TEST_F):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r161252 r161257  
     12014-01-03  Jinwoo Song  <jinwoo7.song@samsung.com>
     2
     3        VibrationPattern should allocate an single vector instance for single integer input
     4        https://bugs.webkit.org/show_bug.cgi?id=126417
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        When the Vibration pattern is set with a single integer, the VibrationPattern should
     9        be set with this integer as a vibration time. But the VibrationPattern(unsigned vector) was
     10        initialized with a single parameter, the vibration time, so the time was used to set
     11        the size of vector.
     12
     13        * Modules/vibration/NavigatorVibration.cpp:
     14        (WebCore::NavigatorVibration::vibrate):
     15
    1162014-01-02  Jaehun Lim  <ljaehun.lim@samsung.com>
    217
  • trunk/Source/WebCore/Modules/vibration/NavigatorVibration.cpp

    r153728 r161257  
    4141bool NavigatorVibration::vibrate(Navigator* navigator, unsigned time)
    4242{
    43     return NavigatorVibration::vibrate(navigator, VibrationPattern(time));
     43    return NavigatorVibration::vibrate(navigator, VibrationPattern(1, time));
    4444}
    4545
  • trunk/Source/WebKit2/ChangeLog

    r161256 r161257  
     12014-01-03  Jinwoo Song  <jinwoo7.song@samsung.com>
     2
     3        VibrationPattern should allocate an single vector instance for single integer input
     4        https://bugs.webkit.org/show_bug.cgi?id=126417
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Fix a vibration unit test regression after r161139. Also remove unnecessary test cases.
     9
     10        * UIProcess/API/efl/tests/test_ewk2_view.cpp:
     11        (EWK2ViewTest::loadVibrationHTMLString):
     12        (TEST_F):
     13
    1142014-01-02  Carlos Garcia Campos  <cgarcia@igalia.com>
    215
  • trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp

    r161139 r161257  
    174174    }
    175175
    176     static void loadVibrationHTMLString(Evas_Object* webView, const char* vibrationPattern, bool waitForVibrationEvent, VibrationCbData* data)
     176    static void loadVibrationHTMLString(Evas_Object* webView, const char* vibrationPattern, VibrationCbData* data)
    177177    {
    178178        const char* content =
     
    188188        ewk_view_html_string_load(webView, eina_strbuf_string_get(buffer), 0, 0);
    189189        eina_strbuf_free(buffer);
    190 
    191         if (!waitForVibrationEvent)
    192             return;
    193190    }
    194191
     
    919916TEST_F(EWK2ViewTest, ewk_context_vibration_client_callbacks_set)
    920917{
    921     VibrationCbData data = { false, false, 0, 5000 };
     918    VibrationCbData data = { false, false, false, 0, 5000 };
    922919    evas_object_smart_callback_add(webView(), "vibrate", onVibrate, &data);
    923920    evas_object_smart_callback_add(webView(), "cancel,vibration", onCancelVibration, &data);
    924921
    925922    // Vibrate for 5 seconds.
    926     loadVibrationHTMLString(webView(), "5000", true, &data);
     923    loadVibrationHTMLString(webView(), "5000", &data);
    927924    waitUntilTrue(data.testFinished);
    928925    ASSERT_TRUE(data.didReceiveVibrate);
    929926
    930927    // Cancel any existing vibrations.
    931     loadVibrationHTMLString(webView(), "0", true, &data);
     928    loadVibrationHTMLString(webView(), "0", &data);
    932929    waitUntilTrue(data.testFinished);
    933930    ASSERT_TRUE(data.didReceiveCancelVibration);
    934931
    935932    // This case the pattern will cause the device to vibrate for 200 ms, be still for 100 ms, and then vibrate for 5000 ms.
    936     loadVibrationHTMLString(webView(), "[200, 100, 5000]", true, &data);
     933    loadVibrationHTMLString(webView(), "[200, 100, 5000]", &data);
    937934    waitUntilTrue(data.testFinished);
    938935    ASSERT_EQ(2, data.vibrateCalledCount);
     
    940937
    941938    // Cancel outstanding vibration pattern.
    942     loadVibrationHTMLString(webView(), "[0]", true, &data);
     939    loadVibrationHTMLString(webView(), "[0]", &data);
    943940    waitUntilTrue(data.testFinished);
    944941    ASSERT_TRUE(data.didReceiveCancelVibration);
     
    947944    evas_object_smart_callback_del(webView(), "vibrate", onVibrate);
    948945    evas_object_smart_callback_del(webView(), "cancel,vibration", onCancelVibration);
    949 
    950     // Make sure we don't receive vibration event.
    951     loadVibrationHTMLString(webView(), "[5000]", false, &data);
    952     waitUntilTrue(data.testFinished);
    953     ASSERT_TRUE(waitUntilTitleChangedTo("Loaded"));
    954     ASSERT_STREQ("Loaded", ewk_view_title_get(webView()));
    955     ASSERT_FALSE(data.didReceiveVibrate);
    956 
    957     // Make sure we don't receive cancel vibration event.
    958     loadVibrationHTMLString(webView(), "0", false, &data);
    959     waitUntilTrue(data.testFinished);
    960     ASSERT_TRUE(waitUntilTitleChangedTo("Loaded"));
    961     ASSERT_STREQ("Loaded", ewk_view_title_get(webView()));
    962     ASSERT_FALSE(data.didReceiveCancelVibration);
    963946}
    964947
Note: See TracChangeset for help on using the changeset viewer.