%endif
Name: crosswalk
-Version: 8.37.186.0
+Version: 8.37.187.0
Release: 0
Summary: Crosswalk is an app runtime based on Chromium
License: (BSD-3-Clause and LGPL-2.1+)
MAJOR=8
MINOR=37
-BUILD=186
+BUILD=187
PATCH=0
Application::LaunchParams launch_params;
launch_params.force_fullscreen = cmd_line.HasSwitch(switches::kFullscreen);
- launch_params.entry_points = Application::URLKey;
+ launch_params.entry_points = Application::StartURLKey;
return !!application_service_->Launch(application_data, launch_params);
}
bool ok = manifest_->GetString(widget_keys::kVersionKey, &version_str);
if (!ok) {
*error = base::ASCIIToUTF16(errors::kInvalidVersion);
- return false;
+ return true;
}
version_.reset(new base::Version(version_str));
jsfiles_to_copy = [
'xwalk/experimental/launch_screen/launch_screen_api.js',
'xwalk/experimental/presentation/presentation_api.js',
- 'xwalk/sysapps/device_capabilities/device_capabilities_api.js'
+ 'xwalk/runtime/android/core_internal/src/org/xwalk/core/'
+ + 'internal/extension/api/device_capabilities/device_capabilities_api.js'
]
# Copy JS binding file to assets/jsapi folder.
%endif
Name: crosswalk
-Version: 8.37.186.0
+Version: 8.37.187.0
Release: 0
Summary: Crosswalk is an app runtime based on Chromium
License: (BSD-3-Clause and LGPL-2.1+)
assert uri.getScheme().equals(FILE_SCHEME);
assert uri.getPath() != null;
assert uri.getPath().startsWith(nativeGetAndroidAssetPath());
- String path = uri.getPath().replaceFirst(nativeGetAndroidAssetPath(), "");
try {
AssetManager assets = context.getAssets();
- return assets.open(path, AssetManager.ACCESS_STREAMING);
+ return assets.open(getAssetPath(uri), AssetManager.ACCESS_STREAMING);
} catch (IOException e) {
Log.e(TAG, "Unable to open asset URL: " + uri);
return null;
mDIPScale = dipScale;
}
+ public double getDIPScale() {
+ return mDIPScale;
+ }
+
final XWalkContentsClientCallbackHelper getCallbackHelper() {
return mCallbackHelper;
}
@JNINamespace("xwalk")
class XWalkContentsClientBridge extends XWalkContentsClient
implements ContentViewDownloadDelegate {
- private static final String TAG = XWalkContentsClientBridge.class.getName();
+ private static final String TAG = XWalkContentsClientBridge.class.getName();
private XWalkViewInternal mXWalkView;
private XWalkUIClientInternal mXWalkUIClient;
// The native peer of the object
private long mNativeContentsClientBridge;
+ private float mPageScaleFactor;
+
private class InterceptNavigationDelegateImpl implements InterceptNavigationDelegate {
private XWalkContentsClient mContentsClient;
public void onDangerousDownload(String filename, int downloadId) {
}
+ @CalledByNative
+ public void onWebLayoutPageScaleFactorChanged(float pageScaleFactor) {
+ if (mPageScaleFactor == pageScaleFactor) return;
+
+ float oldPageScaleFactor = mPageScaleFactor;
+ double dipScale = getDIPScale();
+ mPageScaleFactor = pageScaleFactor;
+ onScaleChanged((float)(oldPageScaleFactor * dipScale),
+ (float)(mPageScaleFactor * dipScale));
+ }
+
//--------------------------------------------------------------------------------------------
// Native methods
//--------------------------------------------------------------------------------------------
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/frame_navigate_params.h"
+#include "xwalk/runtime/browser/android/xwalk_contents_client_bridge.h"
#include "xwalk/runtime/browser/runtime_context.h"
#include "xwalk/runtime/common/android/xwalk_render_view_messages.h"
OnDocumentHasImagesResponse)
IPC_MESSAGE_HANDLER(XWalkViewHostMsg_UpdateHitTestData,
OnUpdateHitTestData)
+ IPC_MESSAGE_HANDLER(XWalkViewHostMsg_PageScaleFactorChanged,
+ OnPageScaleFactorChanged)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
}
}
+void XWalkRenderViewHostExt::OnPageScaleFactorChanged(float page_scale_factor) {
+ XWalkContentsClientBridgeBase* client_bridge =
+ XWalkContentsClientBridgeBase::FromWebContents(web_contents());
+ if (client_bridge != NULL)
+ client_bridge->OnWebLayoutPageScaleFactorChanged(page_scale_factor);
+}
+
} // namespace xwalk
void OnDocumentHasImagesResponse(int msg_id, bool has_images);
void OnUpdateHitTestData(const XWalkHitTestData& hit_test_data);
void OnPictureUpdated();
+ void OnPageScaleFactorChanged(float page_scale_factor);
bool IsRenderViewReady() const;
}
}
+void XWalkContentsClientBridge::OnWebLayoutPageScaleFactorChanged(
+ float page_scale_factor) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (obj.is_null())
+ return;
+ Java_XWalkContentsClientBridge_onWebLayoutPageScaleFactorChanged(
+ env, obj.obj(), page_scale_factor);
+}
+
void XWalkContentsClientBridge::ConfirmJsResult(JNIEnv* env,
jobject,
int id,
int notification_id,
const SkBitmap& icon)
OVERRIDE;
+ virtual void OnWebLayoutPageScaleFactorChanged(
+ float page_scale_factor)
+ OVERRIDE;
bool OnReceivedHttpAuthRequest(const base::android::JavaRef<jobject>& handler,
const std::string& host,
int notification_id,
const SkBitmap& icon)
= 0;
+ virtual void OnWebLayoutPageScaleFactorChanged(float page_scale_factor) = 0;
};
} // namespace xwalk
" return xhr.status;" +
"})();";
- getInstrumentation().runOnMainSync(new Runnable() {
- @Override
- public void run() {
- getXWalkView().getSettings().setJavaScriptEnabled(true);
- }
- });
-
final String aboutPageUrl = addAboutPageToTestServer(mWebServer);
loadUrlSync(aboutPageUrl);
import org.xwalk.core.XWalkResourceClient;
import org.xwalk.core.XWalkUIClient;
import org.xwalk.core.XWalkView;
-import org.xwalk.core.internal.XWalkSettings;
public class XWalkViewTestBase
extends ActivityInstrumentationTestCase2<XWalkViewTestRunnerActivity> {
});
}
- static class ViewPair {
- private final XWalkView content0;
- private final TestHelperBridge client0;
- private final XWalkView content1;
- private final TestHelperBridge client1;
-
- ViewPair(XWalkView content0, TestHelperBridge client0,
- XWalkView content1, TestHelperBridge client1) {
- this.content0 = content0;
- this.client0 = client0;
- this.content1 = content1;
- this.client1 = client1;
- }
-
- XWalkView getContent0() {
- return content0;
- }
-
- TestHelperBridge getClient0() {
- return client0;
- }
-
- XWalkView getContent1() {
- return content1;
- }
-
- TestHelperBridge getClient1() {
- return client1;
- }
- }
-
public XWalkViewTestBase() {
super(XWalkViewTestRunnerActivity.class);
}
});
}
- protected XWalkSettings getXWalkSettingsOnUiThreadByContent(
- final XWalkView xwalkContent) throws Exception {
- return runTestOnUiThreadAndGetResult(new Callable<XWalkSettings>() {
- @Override
- public XWalkSettings call() throws Exception {
- return xwalkContent.getSettings();
- }
- });
- }
-
protected XWalkView createXWalkViewContainerOnMainSync(
final Context context,
final XWalkUIClient uiClient,
return xWalkViewContainer.get();
}
- protected ViewPair createViewsOnMainSync(final TestHelperBridge helperBridge0,
- final TestHelperBridge helperBridge1,
- final XWalkUIClient uiClient0,
- final XWalkUIClient uiClient1,
- final XWalkResourceClient resourceClient0,
- final XWalkResourceClient resourceClient1,
- final Context context) throws Throwable {
- final XWalkView walkView0 = createXWalkViewContainerOnMainSync(context,
- uiClient0, resourceClient0);
- final XWalkView walkView1 = createXWalkViewContainerOnMainSync(context,
- uiClient1, resourceClient1);
- final AtomicReference<ViewPair> viewPair = new AtomicReference<ViewPair>();
-
- getInstrumentation().runOnMainSync(new Runnable() {
- @Override
- public void run() {
- viewPair.set(new ViewPair(walkView0, helperBridge0, walkView1, helperBridge1));
- }
- });
-
- return viewPair.get();
- }
-
protected void loadAssetFile(String fileName) throws Exception {
String fileContent = getFileContent(fileName);
loadDataSync(fileName, fileContent, "text/html", false);
return helper.getJsonResultAndClear();
}
- protected ViewPair createViews() throws Throwable {
- TestHelperBridge helperBridge0 = new TestHelperBridge();
- TestHelperBridge helperBridge1 = new TestHelperBridge();
- TestXWalkUIClientBase uiClient0 = new TestXWalkUIClientBase(helperBridge0);
- TestXWalkUIClientBase uiClient1 = new TestXWalkUIClientBase(helperBridge1);
- TestXWalkResourceClientBase resourceClient0 =
- new TestXWalkResourceClientBase(helperBridge0);
- TestXWalkResourceClientBase resourceClient1 =
- new TestXWalkResourceClientBase(helperBridge1);
- ViewPair viewPair =
- createViewsOnMainSync(helperBridge0, helperBridge1, uiClient0, uiClient1,
- resourceClient0, resourceClient1, getActivity());
-
- return viewPair;
- }
-
protected String getUrlOnUiThread() throws Exception {
return runTestOnUiThreadAndGetResult(new Callable<String>() {
@Override
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Copyright (c) 2013-2014 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.xwalk.core.xwview.test;
+package org.xwalk.core.internal.xwview.test;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.test.suitebuilder.annotation.SmallTest;
import org.chromium.base.test.util.Feature;
-import org.xwalk.core.XWalkView;
import org.xwalk.core.internal.XWalkClient;
import org.xwalk.core.internal.XWalkNavigationHandlerImpl;
+import org.xwalk.core.internal.XWalkViewInternal;
/**
* Test suite for handling ActionUri.
*/
-public class HandleActionUriTest extends XWalkViewTestBase {
+public class HandleActionUriTest extends XWalkViewInternalTestBase {
class TestXWalkNavigationHandler extends XWalkNavigationHandlerImpl {
private Intent intentToStart;
}
@SmallTest
+ @Feature({"LoadUnnormalized"})
+ public void testAndroidAssetUrlUnnormalized() throws Throwable {
+ final String url = "file:///android_asset/www//index.html";
+
+ loadUrlSync(url);
+ assertEquals(expectedLocalTitle, getTitleOnUiThread());
+ }
+
+ @SmallTest
@Feature({"LoadWithData"})
public void testWithData() throws Throwable {
final String name = "index.html";
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Copyright (c) 2013-2014 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.xwalk.core.xwview.test;
+package org.xwalk.core.internal.xwview.test;
import android.graphics.Bitmap;
import android.test.suitebuilder.annotation.SmallTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.UrlUtils;
-import org.xwalk.core.XWalkView;
import org.xwalk.core.internal.XWalkClient;
+import org.xwalk.core.internal.XWalkViewInternal;
/**
* Test suite for setDatabaseEnabled().
*/
-public class SetDatabaseEnabledTest extends XWalkViewTestBase {
+public class SetDatabaseEnabledTest extends XWalkViewInternalTestBase {
private static final boolean ENABLED = true;
private static final boolean DISABLED = false;
}
@SmallTest
- @Feature({"XWalkView", "Preferences"})
+ @Feature({"XWalkViewInternal", "Preferences"})
public void testDatabaseEnabled() throws Throwable {
XWalkViewSettingsDatabaseTestHelper helper = new XWalkViewSettingsDatabaseTestHelper();
helper.setAlteredSettingValue();
}
@SmallTest
- @Feature({"XWalkView", "Preferences"})
+ @Feature({"XWalkViewInternal", "Preferences"})
public void testDatabaseDisabled() throws Throwable {
XWalkViewSettingsDatabaseTestHelper helper = new XWalkViewSettingsDatabaseTestHelper();
helper.setInitialSettingValue();
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Copyright (c) 2013-2014 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.xwalk.core.xwview.test;
+package org.xwalk.core.internal.xwview.test;
import android.graphics.Bitmap;
import android.test.suitebuilder.annotation.SmallTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.UrlUtils;
-import org.xwalk.core.XWalkView;
import org.xwalk.core.internal.XWalkClient;
import org.xwalk.core.internal.XWalkSettings;
+import org.xwalk.core.internal.XWalkViewInternal;
import org.xwalk.core.internal.XWalkWebChromeClient;
/**
* Test suite for setDomStorageEnabled().
*/
-public class SetDomStorageEnabledTest extends XWalkViewTestBase {
+public class SetDomStorageEnabledTest extends XWalkViewInternalTestBase {
private static final boolean ENABLED = true;
private static final boolean DISABLED = false;
abstract class XWalkViewSettingsTestHelper<T> {
- protected final XWalkView mXWalkView;
+ protected final XWalkViewInternal mXWalkViewInternal;
protected final XWalkSettings mXWalkSettings;
- XWalkViewSettingsTestHelper(XWalkView xWalkContent,
+ XWalkViewSettingsTestHelper(XWalkViewInternal xWalkContent,
boolean requiresJsEnabled) throws Throwable {
- mXWalkView = xWalkContent;
+ mXWalkViewInternal = xWalkContent;
mXWalkSettings = getXWalkSettingsOnUiThreadByContent(xWalkContent);
mXWalkSettings.setDomStorageEnabled(false);
if (requiresJsEnabled) {
TestHelperBridge mHelperBridge;
XWalkViewSettingsDomStorageEnabledTestHelper(
- XWalkView xWalkContent,
+ XWalkViewInternal xWalkContent,
final TestHelperBridge helperBridge) throws Throwable {
super(xWalkContent, true);
mHelperBridge = helperBridge;
protected void doEnsureSettingHasValue(Boolean value) throws Throwable {
// It is not permitted to access localStorage from data URLs in WebKit,
// that is why a standalone page must be used.
- loadUrlSyncByContent(mXWalkView, mHelperBridge,
+ loadUrlSyncByContent(mXWalkViewInternal, mHelperBridge,
UrlUtils.getTestFileUrl("xwalkview/localStorage.html"));
assertEquals(
value == ENABLED ? HAS_LOCAL_STORAGE : NO_LOCAL_STORAGE,
* Verifies the following statements about a setting:
* - initially, the setting has a default value;
* - the setting can be switched to an alternate value and back;
- * - switching a setting in the first XWalkView doesn't affect the setting
- * state in the second XWalkView and vice versa.
+ * - switching a setting in the first XWalkViewInternal doesn't affect the setting
+ * state in the second XWalkViewInternal and vice versa.
*
* @param helper0 Test helper for the first ContentView
* @param helper1 Test helper for the second ContentView
}
@SmallTest
- @Feature({"XWalkView", "Preferences"})
+ @Feature({"XWalkViewInternal", "Preferences"})
public void testDomStorageEnabledWithTwoViews() throws Throwable {
ViewPair views = createViews();
runPerViewSettingsTest(
new XWalkViewSettingsDomStorageEnabledTestHelper(
- views.getContent0(), views.getClient0()),
+ views.getView0(), views.getClient0()),
new XWalkViewSettingsDomStorageEnabledTestHelper(
- views.getContent1(), views.getClient1()));
+ views.getView1(), views.getClient1()));
}
}
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Copyright (c) 2013-2014 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.xwalk.core.xwview.test;
+package org.xwalk.core.internal.xwview.test;
import android.graphics.Bitmap;
import android.test.suitebuilder.annotation.SmallTest;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
-import org.xwalk.core.XWalkView;
import org.xwalk.core.internal.XWalkClient;
+import org.xwalk.core.internal.XWalkViewInternal;
/**
- * Test case for XWalkView.setNetworkAvailable method
+ * Test case for XWalkViewInternal.setNetworkAvailable method
*
* Once setNetworkAvailable is called, the navigator.onLine property will be
* set, and window.ononline/onoffline event will be fired if the property is
* changed.
*/
-public class SetNetworkAvailableTest extends XWalkViewTestBase {
+public class SetNetworkAvailableTest extends XWalkViewInternalTestBase {
@Override
public void setUp() throws Exception {
super.setUp();
loadAssetFile("navigator.online.html");
String title = getTitleOnUiThread();
- final XWalkView xwView = getXWalkView();
+ final XWalkViewInternal xwView = getXWalkView();
if ("true".equals(title)) {
getInstrumentation().runOnMainSync(new Runnable() {
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Copyright (c) 2013-2014 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.xwalk.core.xwview.test;
+package org.xwalk.core.internal.xwview.test;
import android.graphics.Bitmap;
import android.content.Context;
import org.apache.http.HttpRequest;
import org.chromium.base.test.util.Feature;
import org.chromium.net.test.util.TestWebServer;
-import org.xwalk.core.XWalkView;
import org.xwalk.core.internal.XWalkClient;
import org.xwalk.core.internal.XWalkSettings;
+import org.xwalk.core.internal.XWalkViewInternal;
/**
* Test suite for setUserAgentString() and getUserAgentString().
*/
-public class UserAgentTest extends XWalkViewTestBase {
+public class UserAgentTest extends XWalkViewInternalTestBase {
@Override
public void setUp() throws Exception {
super.setUp();
'<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/echoSync.html',
'<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/framesEcho.html',
'<(PRODUCT_DIR)/xwalk_xwview_test/assets/index.html',
- '<(PRODUCT_DIR)/xwalk_xwview_test/assets/navigator.online.html',
'<(PRODUCT_DIR)/xwalk_xwview_test/assets/window.close.html',
],
'asset_location': '<(PRODUCT_DIR)/xwalk_xwview_test/assets',
'test/android/data/echoSync.html',
'test/android/data/framesEcho.html',
'test/android/data/index.html',
- 'test/android/data/navigator.online.html',
'test/android/data/window.close.html',
],
},
'<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/framesEcho.html',
'<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/geolocation.html',
'<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/index.html',
+ '<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/navigator.online.html',
'<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/notification.html',
'<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/renderHung.html',
],
'test/android/data/framesEcho.html',
'test/android/data/geolocation.html',
'test/android/data/index.html',
+ 'test/android/data/navigator.online.html',
'test/android/data/notification.html',
'test/android/data/renderHung.html',
],