863678fa486b51c34776746262e3e5b2a2359958
[platform/framework/web/crosswalk.git] / src / xwalk / test / android / core / javatests / src / org / xwalk / core / xwview / test / GetAPIVersionTest.java
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Copyright (c) 2014 Intel Corporation. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5
6 package org.xwalk.core.xwview.test;
7
8 import android.test.suitebuilder.annotation.SmallTest;
9
10 import org.chromium.base.test.util.Feature;
11
12 import java.util.regex.Matcher;
13 import java.util.regex.Pattern;
14
15 /**
16  * Test suite for getAPIVersion().
17  */
18 public class GetAPIVersionTest extends XWalkViewTestBase {
19
20     @Override
21     public void setUp() throws Exception {
22         super.setUp();
23
24         setXWalkClient(new XWalkViewTestBase.TestXWalkClient());
25     }
26
27     @SmallTest
28     @Feature({"GetAPIVersion"})
29     public void testGetAPIVersion() throws Throwable {
30         String version = getAPIVersionOnUiThread();
31         Pattern pattern = Pattern.compile("^[0-9]+(.[0-9]+)$");
32         Matcher matcher = pattern.matcher(version);
33         assertTrue("The API version is invalid.", matcher.find());
34     }
35 }