+++ /dev/null
-Author: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
-
-Angle : Do not use .git/index as a dependency. Tizen is built by packing
-everything in a tarball where there is no .git/ directory.
-
-This has been fixed upstream already :
-http://code.google.com/p/chromium/issues/detail?id=395705
-
-diff --git src/third_party/angle/src/angle.gypi src/third_party/angle/src/angle.gypi
-index 5339369..c7ef8c1 100644
---- src/third_party/angle/src/angle.gypi
-+++ src/third_party/angle/src/angle.gypi
-@@ -56,7 +56,7 @@
- {
- 'action_name': 'Generate Commit ID Header',
- 'message': 'Generating commit ID header...',
-- 'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.py', '<(angle_path)/.git/index' ],
-+ 'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.py' ],
- 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
- 'action': [ 'python', '<(SHARED_INTERMEDIATE_DIR)/commit_id.py', '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
- },
%endif
Name: crosswalk
-Version: 8.37.180.0
+Version: 8.37.183.0
Release: 0
Summary: Crosswalk is an app runtime based on Chromium
License: (BSD-3-Clause and LGPL-2.1+)
Source1003: %{name}.png
Patch9: Blink-Add-GCC-flag-Wno-narrowing-fix-64bits-build.patch
Patch10: crosswalk-do-not-look-for-gtk-dependencies-on-x11.patch
-Patch11: crosswalk-angle-do-not-depend-git-index.patch
BuildRequires: bison
BuildRequires: bzip2-devel
BuildRequires: python-xml
BuildRequires: perl
BuildRequires: which
+BuildRequires: pkgconfig(ail)
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(appcore-common)
BuildRequires: pkgconfig(cairo)
%patch10
%endif
-%patch11
-
%build
# For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
'webkit_rev':
'@f35b0cb58d8f1d16e8794f73805e9cfa1c9e6fa9',
'angle_revision':
- 'ebba7d306b34a56f57ff1b87682bdc67cc9c50f8'
+ 'c333af9c8e6b776363b722d9e9c4fed0b597f984'
}
deps = {
ShankarGanesh K <blr.bmlab@gmail.com>
Shez Baig <sbaig1@bloomberg.net>
Shiliu Wang <aofdwsl@gmail.com>
+Shiliu Wang <shiliu.wang@intel.com>
Shouqun Liu <shouqun.liu@intel.com>
Shreyas VA <v.a.shreyas@gmail.com>
Simon Arlott <simon.arlott@gmail.com>
'src/sdch/open-vcdiff':\r
(Var("open-vcdiff")) + '/trunk@42',\r
'src/third_party/angle':\r
- (Var("git.chromium.org")) + '/angle/angle.git@ebba7d306b34a56f57ff1b87682bdc67cc9c50f8',\r
+ (Var("git.chromium.org")) + '/angle/angle.git@c333af9c8e6b776363b722d9e9c4fed0b597f984',\r
'build/third_party/lighttpd':\r
'/trunk/deps/third_party/lighttpd@58968',\r
'src/buildtools':\r
-LASTCHANGE=283104
+LASTCHANGE=284396
import android.app.Activity;
import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
import android.util.Log;
import com.google.common.annotations.VisibleForTesting;
return;
}
- activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
+ int defaultOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
+
+ try {
+ ActivityInfo info = activity.getPackageManager().getActivityInfo(
+ activity.getComponentName(), PackageManager.GET_META_DATA);
+ defaultOrientation = info.screenOrientation;
+ } catch (PackageManager.NameNotFoundException e) {
+ // Do nothing, defaultOrientation should be SCREEN_ORIENTATION_UNSPECIFIED.
+ } finally {
+ activity.setRequestedOrientation(defaultOrientation);
+ }
}
private ScreenOrientationProvider() {
#include "media/video/video_decode_accelerator.h"
#include "media/ozone/media_ozone_platform.h"
-//#include "ozone/media/vaapi_video_decode_accelerator.h"
+#include "ozone/media/vaapi_video_decode_accelerator.h"
namespace media {
// MediaOzonePlatform:
virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator(
const base::Callback<bool(void)>& make_context_current) OVERRIDE {
- // Temporarily disable the support till
- // https://github.com/01org/ozone-wayland/issues/240 is resolved.
- //return new VaapiVideoDecodeAccelerator(make_context_current);
- return NULL;
+ return new VaapiVideoDecodeAccelerator(make_context_current);
}
private:
'sources': [
'media_ozone_platform_wayland.cc',
'media_ozone_platform_wayland.h',
- #'h264_dpb.cc',
- #'h264_dpb.h',
- #'va_surface.h',
- #'vaapi_h264_decoder.cc',
- #'vaapi_h264_decoder.h',
- #'vaapi_video_decode_accelerator.cc',
- #'vaapi_video_decode_accelerator.h',
- #'vaapi_wrapper.cc',
- #'vaapi_wrapper.h',
+ 'h264_dpb.cc',
+ 'h264_dpb.h',
+ 'va_surface.h',
+ 'vaapi_h264_decoder.cc',
+ 'vaapi_h264_decoder.h',
+ 'vaapi_video_decode_accelerator.cc',
+ 'vaapi_video_decode_accelerator.h',
+ 'vaapi_wrapper.cc',
+ 'vaapi_wrapper.h',
],
'variables': {
'extra_header': 'media/va_wayland_stub_header.fragment',
'intermediate_dir': '<(INTERMEDIATE_DIR)',
'output_root': '<(SHARED_INTERMEDIATE_DIR)/va',
},
+ 'dependencies': [
+ '<(DEPTH)/ui/gl/gl.gyp:gl',
+ ],
'include_dirs': [
'<(DEPTH)/third_party/libva',
+ '<(DEPTH)/third_party/mesa/src/include',
'<(output_root)',
'<(SHARED_INTERMEDIATE_DIR)/ui/gl',
],
--- /dev/null
+From f62cb73e2053d5fda4f031abea007e0a455dac38 Mon Sep 17 00:00:00 2001
+From: jiajia qin <jiajia.qin@intel.com>
+Date: Thu, 24 Jul 2014 18:37:35 +0800
+Subject: [PATCH] Temporarily remove ozone dependency for gl
+
+The old implementation will result that the third party window system can't depend on ui/gl
+because of cycling dependency. So temporarily remove ozone dependency for gl until we find
+a better method to resolve it.
+
+BUG=240
+---
+ ui/gl/gl.gyp | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/ui/gl/gl.gyp b/ui/gl/gl.gyp
+index ac780d7..ba04c0c 100644
+--- a/ui/gl/gl.gyp
++++ b/ui/gl/gl.gyp
+@@ -295,12 +295,6 @@
+ ['OS!="android"', {
+ 'sources/': [ ['exclude', '^android/'] ],
+ }],
+- ['use_ozone==1', {
+- 'dependencies': [
+- '../ozone/ozone.gyp:ozone',
+- '../ozone/ozone.gyp:ozone_base',
+- ],
+- }],
+ ['OS=="android" and android_webview_build==0', {
+ 'dependencies': [
+ '../android/ui_android.gyp:ui_java',
+--
+1.8.1.2
+
WaylandInputDevice* device = static_cast<WaylandInputDevice*>(data);
if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !device->input_keyboard_) {
device->input_keyboard_ = new WaylandKeyboard();
+ device->input_keyboard_->OnSeatCapabilities(seat, caps);
} else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && device->input_keyboard_) {
+ device->input_keyboard_->OnSeatCapabilities(seat, caps);
delete device->input_keyboard_;
device->input_keyboard_ = NULL;
}
if ((caps & WL_SEAT_CAPABILITY_POINTER) && !device->input_pointer_) {
device->input_pointer_ = new WaylandPointer();
+ device->input_pointer_->OnSeatCapabilities(seat, caps);
} else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && device->input_pointer_) {
+ device->input_pointer_->OnSeatCapabilities(seat, caps);
delete device->input_pointer_;
device->input_pointer_ = NULL;
}
if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !device->input_touch_) {
device->input_touch_ = new WaylandTouchscreen();
+ device->input_touch_->OnSeatCapabilities(seat, caps);
} else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && device->input_touch_) {
+ device->input_touch_->OnSeatCapabilities(seat, caps);
delete device->input_touch_;
device->input_touch_ = NULL;
}
-
- if (device->input_keyboard_)
- device->input_keyboard_->OnSeatCapabilities(seat, caps);
-
- if (device->input_pointer_)
- device->input_pointer_->OnSeatCapabilities(seat, caps);
-
- if (device->input_touch_)
- device->input_touch_->OnSeatCapabilities(seat, caps);
}
void WaylandInputDevice::SetFocusWindowHandle(unsigned windowhandle) {
gyp_cmd += ' -D angle_build_tests=' + ('1' if build_tests else '0')
gyp_cmd += ' -D angle_build_samples=' + ('1' if build_samples else '0')
gyp_cmd += ' -D release_symbols=' + ('true' if release_symbols else 'false')
+ gyp_cmd += ' -D angle_use_commit_id=0'
gyp_cmd += ' ' + os.path.join(script_dir, 'all.gyp')
print 'Generating projects to ' + generation_dir + ' from gyp files...'
</PropertyGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<ClCompile>\r
- <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate\angle;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>\r
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
<BufferSecurityCheck>true</BufferSecurityCheck>\r
<TargetMachine>MachineX86</TargetMachine>\r
</Link>\r
<ResourceCompile>\r
- <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate\angle;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<Culture>0x0409</Culture>\r
<PreprocessorDefinitions>ANGLE_TRANSLATOR_STATIC;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ResourceCompile>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
<ClCompile>\r
- <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate\angle;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>\r
<BufferSecurityCheck>true</BufferSecurityCheck>\r
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
<TargetMachine>MachineX86</TargetMachine>\r
</Link>\r
<ResourceCompile>\r
- <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate\angle;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<Culture>0x0409</Culture>\r
<PreprocessorDefinitions>ANGLE_TRANSLATOR_STATIC;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ResourceCompile>\r
<Project>{63FB0B97-D1D9-5158-8E85-7F5B1E403817}</Project>\r
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
</ProjectReference>\r
- <ProjectReference Include="..\src\commit_id.vcxproj">\r
- <Project>{3B7F5656-177F-52EE-26B3-D6A75368D0A9}</Project>\r
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
- </ProjectReference>\r
<ProjectReference Include="..\src\preprocessor.vcxproj">\r
<Project>{C7BAF548-697D-2DCB-9DF3-9D1506A7B444}</Project>\r
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
<Project>{19386E01-D811-FA3B-9F1E-122BB0C0E9F5}</Project>\r
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
</ProjectReference>\r
+ <ProjectReference Include="..\src\commit_id.vcxproj">\r
+ <Project>{3B7F5656-177F-52EE-26B3-D6A75368D0A9}</Project>\r
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+ </ProjectReference>\r
<ProjectReference Include="..\src\copy_compiler_dll.vcxproj">\r
<Project>{22DC02D5-1598-943C-13E1-82185B469F81}</Project>\r
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "All", "All.vcxproj", "{D048EF6F-5312-AF41-8D8A-DB22CD8634E6}"\r
ProjectSection(ProjectDependencies) = postProject\r
{63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}\r
- {3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}\r
{C7BAF548-697D-2DCB-9DF3-9D1506A7B444} = {C7BAF548-697D-2DCB-9DF3-9D1506A7B444}\r
{276D20F5-2943-414C-0FF6-21F4723A5CF6} = {276D20F5-2943-414C-0FF6-21F4723A5CF6}\r
{C15697F6-5057-016E-BD29-422971875679} = {C15697F6-5057-016E-BD29-422971875679}\r
{19386E01-D811-FA3B-9F1E-122BB0C0E9F5} = {19386E01-D811-FA3B-9F1E-122BB0C0E9F5}\r
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}\r
{22DC02D5-1598-943C-13E1-82185B469F81} = {22DC02D5-1598-943C-13E1-82185B469F81}\r
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}\r
{FBAEE4F6-562A-588F-01F9-72DCABB3B061} = {FBAEE4F6-562A-588F-01F9-72DCABB3B061}\r
EndProjectSection\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "commit_id", "..\src\commit_id.vcxproj", "{3B7F5656-177F-52EE-26B3-D6A75368D0A9}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- {63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}\r
- EndProjectSection\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy_compiler_dll", "..\src\copy_compiler_dll.vcxproj", "{22DC02D5-1598-943C-13E1-82185B469F81}"\r
ProjectSection(ProjectDependencies) = postProject\r
ProjectSection(ProjectDependencies) = postProject\r
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}\r
{3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}\r
- {63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}\r
EndProjectSection\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "..\src\libGLESv2.vcxproj", "{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}"\r
Microsoft Visual Studio Solution File, Format Version 11.00\r
# Visual C++ Express 2010\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "commit_id", "..\src\commit_id.vcxproj", "{3B7F5656-177F-52EE-26B3-D6A75368D0A9}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- {63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}\r
- EndProjectSection\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy_compiler_dll", "..\src\copy_compiler_dll.vcxproj", "{22DC02D5-1598-943C-13E1-82185B469F81}"\r
ProjectSection(ProjectDependencies) = postProject\r
ProjectSection(ProjectDependencies) = postProject\r
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}\r
{3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}\r
- {63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}\r
EndProjectSection\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "..\src\libGLESv2.vcxproj", "{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}"\r
Microsoft Visual Studio Solution File, Format Version 11.00\r
# Visual C++ Express 2010\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "commit_id", "commit_id.vcxproj", "{3B7F5656-177F-52EE-26B3-D6A75368D0A9}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- {63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}\r
- EndProjectSection\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy_compiler_dll", "copy_compiler_dll.vcxproj", "{22DC02D5-1598-943C-13E1-82185B469F81}"\r
ProjectSection(ProjectDependencies) = postProject\r
ProjectSection(ProjectDependencies) = postProject\r
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}\r
{3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}\r
- {63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}\r
EndProjectSection\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "libGLESv2.vcxproj", "{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}"\r
</PropertyGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<ClCompile>\r
- <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>\r
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
<BufferSecurityCheck>true</BufferSecurityCheck>\r
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <DisableSpecificWarnings>4100;4127;4239;4244;4245;4512;4702;4530;4718;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<MinimalRebuild>false</MinimalRebuild>\r
<Optimization>Disabled</Optimization>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;_HAS_EXCEPTIONS=0;_WINDOWS;WIN32;WIN32_LEAN_AND_MEAN;ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };NOMINMAX;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
<RuntimeTypeInfo>true</RuntimeTypeInfo>\r
<TreatWarningAsError>true</TreatWarningAsError>\r
<AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
</Lib>\r
<Link>\r
- <AdditionalDependencies>kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib</AdditionalDependencies>\r
+ <AdditionalDependencies></AdditionalDependencies>\r
<AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
<FixedBaseAddress>false</FixedBaseAddress>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<TargetMachine>MachineX86</TargetMachine>\r
</Link>\r
<ResourceCompile>\r
- <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<Culture>0x0409</Culture>\r
- <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };NOMINMAX;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ResourceCompile>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
<ClCompile>\r
- <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>\r
<BufferSecurityCheck>true</BufferSecurityCheck>\r
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <DisableSpecificWarnings>4100;4127;4239;4244;4245;4512;4702;4530;4718;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<MinimalRebuild>false</MinimalRebuild>\r
<Optimization>MaxSpeed</Optimization>\r
- <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;_HAS_EXCEPTIONS=0;_WINDOWS;WIN32;WIN32_LEAN_AND_MEAN;ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };NOMINMAX;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
<RuntimeTypeInfo>true</RuntimeTypeInfo>\r
<TreatWarningAsError>true</TreatWarningAsError>\r
<AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
</Lib>\r
<Link>\r
- <AdditionalDependencies>kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib</AdditionalDependencies>\r
+ <AdditionalDependencies></AdditionalDependencies>\r
<AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
<FixedBaseAddress>false</FixedBaseAddress>\r
<GenerateDebugInformation>false</GenerateDebugInformation>\r
<TargetMachine>MachineX86</TargetMachine>\r
</Link>\r
<ResourceCompile>\r
- <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<Culture>0x0409</Culture>\r
- <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };NOMINMAX;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ResourceCompile>\r
</ItemDefinitionGroup>\r
<ItemGroup>\r
<None Include="..\..\src\angle.gyp"/>\r
- <None Include="..\..\.git\index">\r
- <ExcludedFromBuild>true</ExcludedFromBuild>\r
- </None>\r
</ItemGroup>\r
<ItemGroup>\r
- <CustomBuild Include="$(OutDir)obj\global_intermediate\commit_id.bat">\r
+ <CustomBuild Include="..\..\src\commit.h">\r
<FileType>Document</FileType>\r
- <Command>call call $(OutDir)obj\global_intermediate\commit_id.bat "$(OutDir)obj\global_intermediate"</Command>\r
- <Message>Generating commit ID header...</Message>\r
- <Outputs>$(OutDir)obj\global_intermediate\commit.h</Outputs>\r
- <AdditionalInputs>..\..\.git\index</AdditionalInputs>\r
+ <Command>call mkdir "$(OutDir)obj\global_intermediate\angle\id" 2>nul & set ERRORLEVEL=0 & copy /Y "..\..\src\commit.h" "$(OutDir)obj\global_intermediate\angle\id\commit.h"</Command>\r
+ <Message>Copying commit.h to $(OutDir)obj/global_intermediate/angle/id\commit.h</Message>\r
+ <Outputs>$(OutDir)obj\global_intermediate\angle\id\commit.h</Outputs>\r
</CustomBuild>\r
</ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="copy_scripts.vcxproj">\r
- <Project>{63FB0B97-D1D9-5158-8E85-7F5B1E403817}</Project>\r
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
- </ProjectReference>\r
- </ItemGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>\r
<ImportGroup Label="ExtensionTargets"/>\r
</Project>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup>\r
- <Filter Include="$(OutDir)obj">\r
- <UniqueIdentifier>{7BD4F48B-77B4-AB58-9E24-A7302D190D1C}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="$(OutDir)obj\global_intermediate">\r
- <UniqueIdentifier>{14CEDE64-16A7-96A9-EF19-5C5D6085FF18}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="$(OutDir)obj\global_intermediate\_excluded_files">\r
- <UniqueIdentifier>{158E591E-B6EA-0C85-8F5A-18EAFA09B4CE}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="..">\r
- <UniqueIdentifier>{739DB09A-CC57-A953-A6CF-F64FA08E4FA7}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="..\..">\r
- <UniqueIdentifier>{739DB09A-CC57-A953-A6CF-F64FA08E4FA7}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="..\..\src">\r
- <UniqueIdentifier>{8CDEE807-BC53-E450-C8B8-4DEBB66742D4}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="..\..\.git">\r
- <UniqueIdentifier>{3C74FDB1-3FB1-8FA9-1073-A344751C6694}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="..\..\.git\_excluded_files">\r
- <UniqueIdentifier>{158E591E-B6EA-0C85-8F5A-18EAFA09B4CE}</UniqueIdentifier>\r
- </Filter>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="$(OutDir)obj\global_intermediate\commit_id.bat">\r
- <Filter>$(OutDir)obj\global_intermediate\_excluded_files</Filter>\r
- </None>\r
- <None Include="..\..\src\angle.gyp">\r
- <Filter>..\..\src</Filter>\r
- </None>\r
- <None Include="..\..\.git\index">\r
- <Filter>..\..\.git\_excluded_files</Filter>\r
- </None>\r
- </ItemGroup>\r
-</Project>\r
<ItemGroup>\r
<CustomBuild Include="..\..\src\copy_compiler_dll.bat">\r
<FileType>Document</FileType>\r
- <Command>call call $(OutDir)obj\global_intermediate\copy_compiler_dll.bat "$(Platform)" "C:\Program Files (x86)\Windows Kits\8.0" "$(OutDir)"</Command>\r
+ <Command>call call $(OutDir)obj\global_intermediate\angle\copy_compiler_dll.bat "$(Platform)" "C:\Program Files (x86)\Windows Kits\8.0" "$(OutDir)"</Command>\r
<Message>Copying D3D Compiler DLL...</Message>\r
<Outputs>$(OutDir)\D3DCompiler_46.dll</Outputs>\r
</CustomBuild>\r
<ItemGroup>\r
<CustomBuild Include="..\..\src\commit_id.py">\r
<FileType>Document</FileType>\r
- <Command>call mkdir "$(OutDir)obj\global_intermediate" 2>nul & set ERRORLEVEL=0 & copy /Y "..\..\src\commit_id.py" "$(OutDir)obj\global_intermediate\commit_id.py"</Command>\r
- <Message>Copying commit_id.py to $(OutDir)obj/global_intermediate\commit_id.py</Message>\r
- <Outputs>$(OutDir)obj\global_intermediate\commit_id.py</Outputs>\r
- </CustomBuild>\r
- <CustomBuild Include="..\..\src\commit_id.bat">\r
- <FileType>Document</FileType>\r
- <Command>call mkdir "$(OutDir)obj\global_intermediate" 2>nul & set ERRORLEVEL=0 & copy /Y "..\..\src\commit_id.bat" "$(OutDir)obj\global_intermediate\commit_id.bat"</Command>\r
- <Message>Copying commit_id.bat to $(OutDir)obj/global_intermediate\commit_id.bat</Message>\r
- <Outputs>$(OutDir)obj\global_intermediate\commit_id.bat</Outputs>\r
+ <Command>call mkdir "$(OutDir)obj\global_intermediate\angle" 2>nul & set ERRORLEVEL=0 & copy /Y "..\..\src\commit_id.py" "$(OutDir)obj\global_intermediate\angle\commit_id.py"</Command>\r
+ <Message>Copying commit_id.py to $(OutDir)obj/global_intermediate/angle\commit_id.py</Message>\r
+ <Outputs>$(OutDir)obj\global_intermediate\angle\commit_id.py</Outputs>\r
</CustomBuild>\r
<CustomBuild Include="..\..\src\copy_compiler_dll.bat">\r
<FileType>Document</FileType>\r
- <Command>call mkdir "$(OutDir)obj\global_intermediate" 2>nul & set ERRORLEVEL=0 & copy /Y "..\..\src\copy_compiler_dll.bat" "$(OutDir)obj\global_intermediate\copy_compiler_dll.bat"</Command>\r
- <Message>Copying copy_compiler_dll.bat to $(OutDir)obj/global_intermediate\copy_compiler_dll.bat</Message>\r
- <Outputs>$(OutDir)obj\global_intermediate\copy_compiler_dll.bat</Outputs>\r
+ <Command>call mkdir "$(OutDir)obj\global_intermediate\angle" 2>nul & set ERRORLEVEL=0 & copy /Y "..\..\src\copy_compiler_dll.bat" "$(OutDir)obj\global_intermediate\angle\copy_compiler_dll.bat"</Command>\r
+ <Message>Copying copy_compiler_dll.bat to $(OutDir)obj/global_intermediate/angle\copy_compiler_dll.bat</Message>\r
+ <Outputs>$(OutDir)obj\global_intermediate\angle\copy_compiler_dll.bat</Outputs>\r
</CustomBuild>\r
</ItemGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>\r
</PropertyGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<ClCompile>\r
- <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>\r
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
<BufferSecurityCheck>true</BufferSecurityCheck>\r
<TargetMachine>MachineX86</TargetMachine>\r
</Link>\r
<ResourceCompile>\r
- <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<Culture>0x0409</Culture>\r
<PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };GL_APICALL=;GL_GLEXT_PROTOTYPES=;EGLAPI=;NOMINMAX;ANGLE_ENABLE_PERF;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ResourceCompile>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
<ClCompile>\r
- <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>\r
<BufferSecurityCheck>true</BufferSecurityCheck>\r
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
<TargetMachine>MachineX86</TargetMachine>\r
</Link>\r
<ResourceCompile>\r
- <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<Culture>0x0409</Culture>\r
<PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };GL_APICALL=;GL_GLEXT_PROTOTYPES=;EGLAPI=;NOMINMAX;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ResourceCompile>\r
<Project>{3B7F5656-177F-52EE-26B3-D6A75368D0A9}</Project>\r
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
</ProjectReference>\r
- <ProjectReference Include="copy_scripts.vcxproj">\r
- <Project>{63FB0B97-D1D9-5158-8E85-7F5B1E403817}</Project>\r
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
- </ProjectReference>\r
</ItemGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>\r
<ImportGroup Label="ExtensionTargets"/>\r
</PropertyGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<ClCompile>\r
- <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>\r
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
<BufferSecurityCheck>true</BufferSecurityCheck>\r
<TargetMachine>MachineX86</TargetMachine>\r
</Link>\r
<ResourceCompile>\r
- <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<Culture>0x0409</Culture>\r
<PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };GL_APICALL=;GL_GLEXT_PROTOTYPES=;EGLAPI=;NOMINMAX;ANGLE_ENABLE_D3D9;ANGLE_ENABLE_D3D11;ANGLE_ENABLE_PERF;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ResourceCompile>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
<ClCompile>\r
- <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>\r
<BufferSecurityCheck>true</BufferSecurityCheck>\r
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
<TargetMachine>MachineX86</TargetMachine>\r
</Link>\r
<ResourceCompile>\r
- <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<Culture>0x0409</Culture>\r
<PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };GL_APICALL=;GL_GLEXT_PROTOTYPES=;EGLAPI=;NOMINMAX;ANGLE_ENABLE_D3D9;ANGLE_ENABLE_D3D11;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ResourceCompile>\r
{
'angle_code': 1,
'angle_post_build_script%': 0,
+ 'angle_gen_path': '<(SHARED_INTERMEDIATE_DIR)/angle',
+ 'angle_id_script_base': 'commit_id.py',
+ 'angle_id_script': '<(angle_gen_path)/<(angle_id_script_base)',
+ 'angle_id_header_base': 'commit.h',
+ 'angle_id_header': '<(angle_gen_path)/id/<(angle_id_header_base)',
+ 'angle_use_commit_id%': '<!(python <(angle_id_script_base) check ..)',
},
'includes':
[
'copies':
[
{
- 'destination': '<(SHARED_INTERMEDIATE_DIR)',
- 'files': [ 'commit_id.bat', 'copy_compiler_dll.bat', 'commit_id.py' ],
+ 'destination': '<(angle_gen_path)',
+ 'files': [ 'copy_compiler_dll.bat', '<(angle_id_script_base)' ],
},
],
},
-
+ ],
+ 'conditions':
+ [
+ ['angle_use_commit_id!=0',
{
- 'target_name': 'commit_id',
- 'type': 'none',
- 'includes': [ '../build/common_defines.gypi', ],
- 'dependencies': [ 'copy_scripts', ],
- 'conditions':
+ 'targets':
[
- ['OS=="win"',
{
+ 'target_name': 'commit_id',
+ 'type': 'none',
+ 'includes': [ '../build/common_defines.gypi', ],
+ 'dependencies': [ 'copy_scripts', ],
'actions':
[
{
- 'action_name': 'Generate Commit ID Header',
- 'message': 'Generating commit ID header...',
+ 'action_name': 'Generate ANGLE Commit ID Header',
+ 'message': 'Generating ANGLE Commit ID',
+ # reference the git index as an input, so we rebuild on changes to the index
+ 'inputs': [ '<(angle_id_script)', '<(angle_path)/.git/index' ],
+ 'outputs': [ '<(angle_id_header)' ],
'msvs_cygwin_shell': 0,
- 'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.bat', '<(angle_path)/.git/index' ],
- 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
- 'action': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.bat', '<(SHARED_INTERMEDIATE_DIR)' ],
+ 'action':
+ [
+ 'python', '<(angle_id_script)', 'gen', '<(angle_path)', '<(angle_id_header)'
+ ],
},
],
- },
- { # OS != win
- 'actions':
+ 'direct_dependent_settings':
+ {
+ 'include_dirs':
+ [
+ '<(angle_gen_path)',
+ ],
+ },
+ }
+ ]
+ },
+ { # angle_use_commit_id==0
+ 'targets':
+ [
+ {
+ 'target_name': 'commit_id',
+ 'type': 'none',
+ 'copies':
[
{
- 'action_name': 'Generate Commit ID Header',
- 'message': 'Generating commit ID header...',
- 'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.py', '<(angle_path)/.git/index' ],
- 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
- 'action': [ 'python', '<(SHARED_INTERMEDIATE_DIR)/commit_id.py', '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
- },
+ 'destination': '<(angle_gen_path)/id',
+ 'files': [ '<(angle_id_header_base)' ]
+ }
],
- }],
- ],
- 'direct_dependent_settings':
- {
- 'include_dirs':
- [
- '<(SHARED_INTERMEDIATE_DIR)',
- ],
- },
- },
- ],
- 'conditions':
- [
+ 'direct_dependent_settings':
+ {
+ 'include_dirs':
+ [
+ '<(angle_gen_path)',
+ ],
+ },
+ }
+ ]
+ }],
['OS=="win"',
{
'targets':
'outputs': [ '<(PRODUCT_DIR)/D3DCompiler_46.dll' ],
'action':
[
- "<(SHARED_INTERMEDIATE_DIR)/copy_compiler_dll.bat",
+ "<(angle_gen_path)/copy_compiler_dll.bat",
"$(PlatformName)",
"<(windows_sdk_path)",
"<(PRODUCT_DIR)"
--- /dev/null
+//
+// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// commit.h:
+// This is a default commit hash header, when git is not available.
+//
+
+#define ANGLE_COMMIT_HASH "unknown hash"
+#define ANGLE_COMMIT_HASH_SIZE 12
+#define ANGLE_COMMIT_DATE "unknown date"
+
+#define ANGLE_DISABLE_PROGRAM_BINARY_LOAD
+++ /dev/null
-@echo off\r
-\r
-REM commit hash\r
-(FOR /F "delims=" %%i IN ('call git rev-parse --short^=12 HEAD') DO set _Str=%%i) || (set _Str=badf00dbad00)\r
-set _Str=#define ANGLE_COMMIT_HASH "%_Str%"\r
-echo %_Str% > %1%\commit.h\r
-\r
-REM commit hash size\r
-set _Str=#define ANGLE_COMMIT_HASH_SIZE 12\r
-echo %_Str% >> %1%\commit.h\r
-\r
-REM commit date\r
-(FOR /F "delims=" %%i IN ('call git show -s --format^="%%ci" HEAD') DO set _Str=%%i) || (set _Str=Unknown Date)\r
-set _Str=#define ANGLE_COMMIT_DATE "%_Str%"\r
-echo %_Str% >> %1%\commit.h\r
import subprocess as sp
import sys
+import os
-def grab_output(*command):
- return sp.Popen(command, stdout=sp.PIPE).communicate()[0].strip()
+# Usage: commit_id.py check <angle_dir> (checks if git is present)
+# Usage: commit_id.py gen <angle_dir> <file_to_write> (generates commit id)
+def grab_output(command, cwd):
+ return sp.Popen(command, stdout=sp.PIPE, shell=True, cwd=cwd).communicate()[0].strip()
+
+operation = sys.argv[1]
+cwd = sys.argv[2]
+
+if operation == 'check':
+ index_path = os.path.join(cwd, '.git', 'index')
+ if os.path.exists(index_path):
+ print("1")
+ else:
+ print("0")
+ sys.exit(0)
+
+output_file = sys.argv[3]
commit_id_size = 12
try:
- commit_id = grab_output('git', 'rev-parse', '--short=%d' % commit_id_size, 'HEAD')
- commit_date = grab_output('git', 'show', '-s', '--format=%ci', 'HEAD')
+ commit_id = grab_output('git rev-parse --short=%d HEAD' % commit_id_size, cwd)
+ commit_date = grab_output('git show -s --format=%ci HEAD', cwd)
except:
commit_id = 'invalid-hash'
commit_date = 'invalid-date'
-hfile = open(sys.argv[1], 'w')
+hfile = open(output_file, 'w')
hfile.write('#define ANGLE_COMMIT_HASH "%s"\n' % commit_id)
hfile.write('#define ANGLE_COMMIT_HASH_SIZE %d\n' % commit_id_size)
-#include "commit.h"
+#include "id/commit.h"
#define ANGLE_MAJOR_VERSION 2
#define ANGLE_MINOR_VERSION 1
bool ProgramBinary::load(InfoLog &infoLog, const void *binary, GLsizei length)
{
+#ifdef ANGLE_DISABLE_PROGRAM_BINARY_LOAD
+ return false;
+#else
BinaryInputStream stream(binary, length);
int format = stream.readInt<int>();
initializeUniformStorage();
return true;
+#endif // #ifdef ANGLE_DISABLE_PROGRAM_BINARY_LOAD
}
bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length)
['OS!="android"', {
'sources/': [ ['exclude', '^android/'] ],
}],
- ['use_ozone==1', {
- 'dependencies': [
- '../ozone/ozone.gyp:ozone',
- ],
- }],
['OS=="android" and android_webview_build==0', {
'dependencies': [
'../android/ui_android.gyp:ui_java',
# Edit these when rolling DEPS.xwalk.
# -----------------------------------
-chromium_crosswalk_rev = '945fe6f188fea055b9bd6ed5fd71bc3431d57eda'
+chromium_crosswalk_rev = 'b93afe0192aa9888d1246e8933d31272afecb7f0'
blink_crosswalk_rev = 'b656b39cc2eb71a9f4b70f8439c2d0a1ca54d619'
v8_crosswalk_rev = '8baa2b8fb1a66d5842294840aed969164c52d978'
-ozone_wayland_rev = 'a68f96aa1668de6f2a922a37b48d713d5d809ee0'
+ozone_wayland_rev = '0a8caf9bc740d767464b2d1d16fec08ff2f91d1f'
crosswalk_git = 'https://github.com/crosswalk-project'
ozone_wayland_git = 'https://github.com/01org'
MAJOR=8
MINOR=37
-BUILD=180
+BUILD=183
PATCH=0
self.app_versionCode = ''
self.fullscreen_flag = ''
self.icon = ''
- self.name = 'AppTemplate'
+ # android_name is only composed of alphabetic characters,
+ # generated from the last segment of input package name.
+ # It will be used for Android project name,
+ # APK file name and Activity name.
+ self.android_name = 'AppTemplate'
self.orientation = 'unspecified'
- self.original_name = ''
+ # app_name is human readable string,
+ # it will be used for the Android application name.
+ self.app_name = ''
self.package = 'org.xwalk.app.template'
self.remote_debugging = ''
from xml.dom import minidom
-def VerifyAppName(value, mode='default'):
- descrpt = 'The app'
- sample = 'helloworld, hello world, hello_world, hello_world1'
- regex = r'[a-zA-Z][\w ]*$'
+def VerifyPackageName(value):
+ regex = r'^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$'
+ descrpt = 'Each part of package'
+ sample = 'org.xwalk.example, org.xwalk.example_'
if len(value) >= 128:
print('To be safe, the length of package name or app name '
'should be less than 128.')
sys.exit(6)
- if mode == 'packagename':
- regex = r'^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$'
- descrpt = 'Each part of package'
- sample = 'org.xwalk.example, org.xwalk.example_'
if not re.match(regex, value):
print('Error: %s name should be started with letters and should not '
def Prepare(app_info, compressor):
- name = app_info.name
+ name = app_info.android_name
package = app_info.package
app_root = app_info.app_root
if os.path.exists(name):
def CustomizeXML(app_info, description, icon_dict, manifest, permissions):
app_version = app_info.app_version
app_versionCode = app_info.app_versionCode
- name = app_info.name
+ name = app_info.android_name
orientation = app_info.orientation
package = app_info.package
- original_name = app_info.original_name
+ app_name = app_info.app_name
+ # Chinese character with unicode get from 'manifest.json' will cause
+ # 'UnicodeEncodeError' when finally wrote to 'AndroidManifest.xml'.
+ if isinstance(app_name, unicode):
+ app_name = app_name.encode("utf-8")
+ # If string start with '@' or '?', it will be treated as Android resource,
+ # which will cause 'No resource found' error,
+ # append a space before '@' or '?' to fix that.
+ if app_name.startswith('@') or app_name.startswith('?'):
+ app_name = ' ' + app_name
manifest_path = os.path.join(name, 'AndroidManifest.xml')
if not os.path.isfile(manifest_path):
print ('Please make sure AndroidManifest.xml'
EditElementAttribute(xmldoc, 'manifest', 'android:description',
"@string/description")
HandlePermissions(permissions, xmldoc)
- EditElementAttribute(xmldoc, 'application', 'android:label', original_name)
+ EditElementAttribute(xmldoc, 'application', 'android:label', app_name)
activity_name = package + '.' + name + 'Activity'
EditElementAttribute(xmldoc, 'activity', 'android:name', activity_name)
- EditElementAttribute(xmldoc, 'activity', 'android:label', original_name)
+ EditElementAttribute(xmldoc, 'activity', 'android:label', app_name)
if orientation:
EditElementAttribute(xmldoc, 'activity', 'android:screenOrientation',
orientation)
def CustomizeJava(app_info, app_url, app_local_path, keep_screen_on):
- name = app_info.name
+ name = app_info.android_name
package = app_info.package
root_path = os.path.join(name, 'src', package.replace('.', os.path.sep))
dest_activity = os.path.join(root_path, name + 'Activity.java')
"""
if not extensions:
return
- name = app_info.name
+ name = app_info.android_name
apk_path = name
apk_assets_path = os.path.join(apk_path, 'assets')
extensions_string = 'xwalk-extensions'
def GenerateCommandLineFile(app_info, xwalk_command_line):
if xwalk_command_line == '':
return
- assets_path = os.path.join(app_info.name, 'assets')
+ assets_path = os.path.join(app_info.android_name, 'assets')
file_path = os.path.join(assets_path, 'xwalk-command-line')
command_line_file = open(file_path, 'w')
command_line_file.write('xwalk ' + xwalk_command_line)
48: 'icons/icon_48.png'}
app_info = AppInfo()
if options.name is not None:
- app_info.name = options.name
+ app_info.android_name = options.name
if options.app_root is None:
app_info.app_root = os.path.join('test_data', 'manifest')
else:
sys.path.append('scripts/gyp')
from app_info import AppInfo
-from customize import VerifyAppName, CustomizeAll, \
- ParseParameterForCompressor, ReplaceSpaceWithUnderscore
+from customize import VerifyPackageName, CustomizeAll, \
+ ParseParameterForCompressor
from dex import AddExeExtensions
from handle_permissions import permission_mapping_table
from manifest_json_parser import HandlePermissionList
return version_str
-def ParseManifest(options, app_info):
+def ParseManifest(options):
parser = ManifestJsonParser(os.path.expanduser(options.manifest))
- original_name = app_info.original_name = parser.GetAppName()
- if options.name:
- VerifyAppName(options.name)
- app_info.original_name = options.name
- options.name = ReplaceSpaceWithUnderscore(options.name)
- else:
- VerifyAppName(original_name)
- options.name = ReplaceSpaceWithUnderscore(original_name)
+ if not options.name:
+ options.name = parser.GetAppName()
if not options.app_version:
options.app_version = parser.GetVersion()
if not options.app_versionCode and not options.app_versionCodeBase:
def Customize(options, app_info, manifest):
- if options.package:
- app_info.package = options.package
- if options.name:
- app_info.name = options.name
+ app_info.package = options.package
+ app_info.app_name = options.name
+ # 'org.xwalk.my_first_app' => 'MyFirstApp'
+ android_name = options.package.split('.')[-1].split('_')
+ app_info.android_name = ''.join([i.capitalize() for i in android_name if i])
if options.app_version:
app_info.app_version = options.app_version
app_info.app_versionCode = MakeVersionCode(options)
RunCommand(cmd)
src_file = os.path.join('out', name + '.apk')
- package_name = options.name
+ package_name = name
if options.app_version:
package_name += ('_' + options.app_version)
if options.mode == 'shared':
os.remove(pak_des_path)
-def PrintPackageInfo(options, packaged_archs):
- package_name_version = os.path.join(options.target_dir, options.name)
+def PrintPackageInfo(options, name, packaged_archs):
+ package_name_version = os.path.join(options.target_dir, name)
if options.app_version:
package_name_version += '_' + options.app_version
print ('A non-platform specific APK for the web application "%s" was '
'generated successfully at\n%s.apk. It requires a shared Crosswalk '
'Runtime to be present.'
- % (options.name, package_name_version))
+ % (name, package_name_version))
return
for arch in packaged_archs:
print ('An APK for the web application "%s" including the Crosswalk '
'Runtime built for %s was generated successfully, which can be '
'found at\n%s_%s.apk.'
- % (options.name, arch, package_name_version, arch))
+ % (name, arch, package_name_version, arch))
all_archs = set(AllArchitectures())
def MakeApk(options, app_info, manifest):
Customize(options, app_info, manifest)
- name = options.name
+ name = app_info.android_name
packaged_archs = []
if options.mode == 'shared':
Execution(options, name)
print('No packages created, aborting')
sys.exit(13)
- PrintPackageInfo(options, packaged_archs)
+ PrintPackageInfo(options, name, packaged_archs)
def main(argv):
parser = optparse.OptionParser()
app_info = AppInfo()
manifest = None
if not options.manifest:
- if options.name:
- VerifyAppName(options.name)
- app_info.original_name = options.name
- options.name = ReplaceSpaceWithUnderscore(options.name)
- else:
- parser.error('An APK name is required. Please use the "--name" option.')
-
# The checks here are really convoluted, but at the moment make_apk
# misbehaves any of the following conditions is true.
if options.app_url:
options.icon_dict = {}
else:
try:
- manifest = ParseManifest(options, app_info)
+ manifest = ParseManifest(options)
except SystemExit as ec:
return ec.code
+ if not options.name:
+ parser.error('An APK name is required. Please use the "--name" option.')
+
if not options.package:
parser.error('A package name is required. Please use the "--package" '
'option.')
- VerifyAppName(options.package, 'packagename')
+ VerifyPackageName(options.package)
if (options.app_root and options.app_local_path and
not os.path.isfile(os.path.join(options.app_root,
try:
MakeApk(options, app_info, manifest)
except SystemExit as ec:
- CleanDir(options.name)
+ CleanDir(app_info.android_name)
CleanDir('out')
CleanDir(xpk_temp_dir)
return ec.code
#!/usr/bin/env python
+# coding: UTF-8
# Copyright (c) 2013, 2014 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
import unittest
import warnings
-from customize import ReplaceSpaceWithUnderscore
-
def Clean(name, app_version):
if os.path.exists(name):
def testName(self):
cmd = ['python', 'make_apk.py', '--app-version=1.0.0',
+ '--app-url=http://www.intel.com',
'--package=org.xwalk.example', self._mode]
out = RunCommand(cmd)
Clean('Example', '1.0.0')
'--package=org.xwalk.example', self._mode]
out = RunCommand(cmd)
self.assertNotIn('An APK name is required', out)
- Clean('Test_Example', '1.0.0')
-
- invalid_chars = '\/:.*?"<>|-'
- for c in invalid_chars:
- invalid_name = '--name=Example' + c
- cmd = ['python', 'make_apk.py', invalid_name,
- '--app-version=1.0.0', '--package=org.xwalk.example',
- '--app-url=http://www.intel.com', self._mode]
- out = RunCommand(cmd)
- self.assertTrue(out.find('invalid characters') != -1)
+ Clean('Example', '1.0.0')
def testToolVersion(self):
cmd = ['python', 'make_apk.py', '--version']
'--manifest=%s' % manifest_path, self._mode]
out = RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
- self.assertTrue(out.find(
- 'WARNING: app.launch.local_path is deprecated for Crosswalk') != -1)
+ self.assertIn('WARNING: app.launch.local_path is deprecated for Crosswalk',
+ out)
Clean('Example', '1.0.0')
+
manifest_path = os.path.join('test_data', 'manifest', 'deprecated',
'manifest_launch_path.json')
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
'--manifest=%s' % manifest_path, self._mode]
out = RunCommand(cmd)
- self.assertTrue(
- out.find('WARNING: launch_path is deprecated for Crosswalk') != -1)
+ self.assertIn('WARNING: launch_path is deprecated for Crosswalk', out)
Clean('Example', '1.0.0')
+
manifest_path = os.path.join('test_data', 'manifest', 'deprecated',
'manifest_permissions.json')
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
'--manifest=%s' % manifest_path, self._mode]
out = RunCommand(cmd)
- self.assertTrue(
- out.find('WARNING: permissions is deprecated for Crosswalk') != -1)
+ self.assertIn('WARNING: permissions is deprecated for Crosswalk', out)
Clean('Example', '1.0.0')
+
manifest_path = os.path.join('test_data', 'manifest',
'manifest_deprecated_icon.json')
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
'--manifest=%s' % manifest_path, self._mode]
out = RunCommand(cmd)
- self.assertTrue(out.find(
- 'WARNING: icons defined as dictionary form is deprecated') != -1)
+ self.assertIn('WARNING: icons defined as dictionary form is deprecated',
+ out)
+ Clean('Example', '1.0.0')
+
+ manifest_path = os.path.join('test_data', 'manifest', 'deprecated',
+ 'manifest_description.json')
+ cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
+ '--manifest=%s' % manifest_path, self._mode]
+ out = RunCommand(cmd)
+ self.assertIn('WARNING: description is deprecated for Crosswalk', out)
+ Clean('Example', '1.0.0')
+
+ manifest_path = os.path.join('test_data', 'manifest', 'deprecated',
+ 'manifest_deprecated_version.json')
+ cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
+ '--manifest=%s' % manifest_path, self._mode]
+ out = RunCommand(cmd)
+ self.assertIn('WARNING: version is deprecated for Crosswalk', out)
def testManifestWithError(self):
manifest_path = os.path.join('test_data', 'manifest',
out = RunCommand(cmd)
self.assertTrue(out.find('no \'name\' field') != -1)
manifest_path = os.path.join('test_data', 'manifest',
- 'manifest_no_version.json')
- cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
- '--manifest=%s' % manifest_path, '--verbose', self._mode]
- out = RunCommand(cmd)
- self.assertTrue(out.find('no \'version\' field') != -1)
- manifest_path = os.path.join('test_data', 'manifest',
'manifest_permissions_format_error.json')
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
'--manifest=%s' % manifest_path, '--verbose', self._mode]
Clean(name, '1.0.0')
- def testInvalidCharacter(self):
- version = '1.0.0'
- start_with_letters = ' should be started with letters'
- app_name_error = 'app name' + start_with_letters
- package_name_error = 'package name' + start_with_letters
- parse_error = 'parser error in manifest.json file'
- directory = os.path.join('test_data', 'manifest', 'invalidchars')
-
- manifest_path = os.path.join(directory, 'manifest_with_space_name.json')
- result = GetResultWithOption(self._mode, manifest_path)
- self.assertTrue(result.find(app_name_error) != -1)
-
- manifest_path = os.path.join(directory, 'manifest_with_chinese_name.json')
- result = GetResultWithOption(self._mode, manifest_path)
- self.assertTrue(result.find(app_name_error) != -1)
-
- manifest_path = os.path.join(directory, 'manifest_parse_error.json')
- result = GetResultWithOption(self._mode, manifest_path)
- self.assertTrue(result.find(parse_error) != -1)
-
- manifest_path = os.path.join(directory, 'manifest_with_invalid_name.json')
- result = GetResultWithOption(self._mode, manifest_path)
- self.assertTrue(result.find(app_name_error) != -1)
-
- manifest_path = os.path.join(directory, 'manifest_contain_space_name.json')
- result = GetResultWithOption(self._mode, manifest_path)
- self.assertTrue(result.find(app_name_error) == -1)
-
- package = 'org.xwalk.example'
- name = '_hello'
- result = GetResultWithOption(self._mode, name=name, package=package)
- self.assertTrue(result.find(app_name_error) != -1)
-
- name = '123hello'
- result = GetResultWithOption(self._mode, name=name, package=package)
- self.assertTrue(result.find(app_name_error) != -1)
-
- name = 'hello_'
- result = GetResultWithOption(self._mode, name=name, package=package)
- self.assertTrue(result.find(app_name_error) == -1)
- Clean(name, version)
-
-
- def VerifyResultForAppNameWithSpace(self, manifest=None, name=None,
- package=None):
- version = '1.0.0'
- GetResultWithOption(manifest=manifest, name=name, package=package)
- if name is None:
- name = 'app name '
- replaced_name = ReplaceSpaceWithUnderscore(name)
- manifest = replaced_name + '/AndroidManifest.xml'
- with open(manifest, 'r') as content_file:
- content = content_file.read()
- self.assertTrue(os.path.exists(manifest))
- self.assertTrue(name in content)
- Clean(replaced_name, version)
+ def verifyResultForAppName(self, app_name):
+ android_manifest = 'Example/AndroidManifest.xml'
+ self.assertTrue(os.path.exists(android_manifest))
+ with open(android_manifest, 'r') as content_file:
+ content = content_file.read()
+ label_name = 'android:label="%s"' % app_name
+ self.assertIn(label_name, content)
+ Clean('Example', '1.0.0')
- def testAppNameWithSpace(self):
- name = 'app name'
- package = 'org.xwalk.app_name'
-
- self.VerifyResultForAppNameWithSpace(name=name, package=package)
- name = 'app name '
- self.VerifyResultForAppNameWithSpace(name=name, package=package)
+ def testAppNameWithNonASCII (self):
+ cmd = ['python', 'make_apk.py', '--name=ä½ å¥½', '--app-version=1.0.0',
+ '--package=org.xwalk.example', '--app-url=http://www.intel.com']
+ RunCommand(cmd)
+ self.verifyResultForAppName('ä½ å¥½')
- directory = os.path.join('test_data', 'manifest', 'invalidchars')
- manifest_path = os.path.join(directory, 'manifest_contain_space_name.json')
- self.VerifyResultForAppNameWithSpace(manifest=manifest_path,
- package=package)
+ manifest_path = os.path.join('test_data', 'manifest', 'invalidchars',
+ 'manifest_with_chinese_name.json')
+ cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
+ '--manifest=%s' % manifest_path]
+ RunCommand(cmd)
+ self.verifyResultForAppName('ä½ å¥½')
def SuiteWithModeOption():
test_suite.addTest(TestMakeApk('testFullscreen'))
test_suite.addTest(TestMakeApk('testIconByOption'))
test_suite.addTest(TestMakeApk('testIconByManifest'))
- test_suite.addTest(TestMakeApk('testInvalidCharacter'))
test_suite.addTest(TestMakeApk('testKeystore'))
test_suite.addTest(TestMakeApk('testManifest'))
test_suite.addTest(TestMakeApk('testManifestWithDeprecatedField'))
def SuiteWithEmptyModeOption():
# Gather all the tests for empty mode option.
test_suite = unittest.TestSuite()
- test_suite.addTest(TestMakeApk('testAppNameWithSpace'))
+ test_suite.addTest(TestMakeApk('testAppNameWithNonASCII'))
test_suite.addTest(TestMakeApk('testCompressor'))
test_suite.addTest(TestMakeApk('testCustomizeFile'))
test_suite.addTest(TestMakeApk('testEmptyMode'))
print('Error: no \'name\' field in manifest.json file.')
sys.exit(1)
ret_dict['app_name'] = self.data_src['name']
- if 'version' not in self.data_src:
- print('Error: no \'version\' field in manifest.json file.')
- sys.exit(1)
- ret_dict['version'] = self.data_src['version']
+ ret_dict['version'] = ''
+ if 'version' in self.data_src and 'xwalk_version' in self.data_src:
+ print('WARNING: the value in "version" will be ignored and support '
+ 'for it will be removed in the future.')
+ ret_dict['version'] = self.data_src['xwalk_version']
+ elif 'xwalk_version' in self.data_src:
+ ret_dict['version'] = self.data_src['xwalk_version']
+ elif 'version' in self.data_src:
+ PrintDeprecationWarning('version')
+ ret_dict['version'] = self.data_src['version']
if 'start_url' in self.data_src:
app_url = self.data_src['start_url']
elif 'launch_path' in self.data_src:
ret_dict['icons'] = {}
app_root = file_path_prefix
ret_dict['description'] = ''
- if 'description' in self.data_src:
+ if 'description' in self.data_src and 'xwalk_description' in self.data_src:
+ print('WARNING: the value in "description" will be ignored and support '
+ 'for it will be removed in the future.')
+ ret_dict['description'] = self.data_src['xwalk_description']
+ elif 'xwalk_description' in self.data_src:
+ ret_dict['description'] = self.data_src['xwalk_description']
+ elif 'description' in self.data_src:
+ PrintDeprecationWarning('description')
ret_dict['description'] = self.data_src['description']
ret_dict['app_url'] = app_url
ret_dict['app_root'] = app_root
"name": "Example",
"version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "Launch screen test",
+ "xwalk_description": "Launch screen test",
"icons": [],
"xwalk_permissions": [],
"xwalk_launch_screen": {
"name": "Example",
"version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "Launch screen test",
+ "xwalk_description": "Launch screen test",
"icons": [],
"xwalk_permissions": [],
"launch_screen": {
{
"name": "Example",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"app": {
"launch": {
"local_path": "http://www.intel.com"
}
},
- "description": "a sample description"
+ "xwalk_description": "a sample description"
}
{
"name": "Example",
+ "version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"icons": [],
"xwalk_permissions": ["geolocation"],
+ "default_locale": "en",
"fullscreen":"true"
}
--- /dev/null
+{
+ "name": "Example",
+ "version": "1.0.0",
+ "start_url": "http://www.intel.com",
+ "description": "a sample description",
+ "xwalk_permissions": [
+ "Contacts",
+ "Geolocation",
+ "Messaging"]
+}
{
"name": "Example",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"launch_path": "http://www.intel.com",
- "description": "a sample description"
+ "xwalk_description": "a sample description"
}
{
"name": "Example",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"permissions": [
"Contacts",
"Geolocation",
{
"name": "app name ",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"fullscreen":"true"
}
{
"name": "\Example",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"fullscreen":"true"
}
{
"name": "ä½ å¥½",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"fullscreen":"true"
}
{
"name": "@*&^Example",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"fullscreen":"true"
}
{
"name": " ",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"fullscreen":"true"
}
{
"name": "Example",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"icons": [],
"xwalk_permissions": [
"Contacts",
{
"name": "Example",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http.html",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"icons": [],
"xwalk_permissions": ["geolocation"],
"display": ["fullscreen"]
{
"name": "Example",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"icons": {
"144": "icons/icon_144.png",
"96": "icons/icon_96.png",
{
"name": "Example",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"icons": [
{
"src": "icons/icon_144.png",
{
"name": "Example",
- "version": "1.0.0",
- "description": "a sample description",
+ "xwalk_version": "1.0.0",
+ "xwalk_description": "a sample description",
"icons": [],
"xwalk_permissions": ["geolocation"],
"fullscreen":"true"
{
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"icons": [],
"xwalk_permissions": ["geolocation"],
"fullscreen":"true"
{
"name": "Example",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"icons": [],
"xwalk_permissions": ["Telephony"],
"fullscreen":"true"
{
"name": "Example",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"icons": [],
"xwalk_permissions": ["geolocation,"],
"fullscreen":"true"
{
"name": "Example",
- "version": "1.0.0",
+ "xwalk_version": "1.0.0",
"start_url": "http://www.intel.com",
- "description": "a sample description",
+ "xwalk_description": "a sample description",
"icons": [],
"xwalk_permissions": [{"filesystem":["write"]},"experimental"],
"fullscreen":"true"
entry_point_used_(Default),
weak_factory_(this) {
DCHECK(runtime_context_);
- DCHECK(data_);
+ DCHECK(data_.get());
DCHECK(observer_);
}
ApplicationService::~ApplicationService() {
}
-void ApplicationService::ChangeLocale(const std::string& locale) {
- ApplicationData::ApplicationDataMap apps;
- if (!application_storage_->GetInstalledApplications(apps))
- return;
-
- ApplicationData::ApplicationDataMap::const_iterator it;
- for (it = apps.begin(); it != apps.end(); ++it) {
- base::string16 error;
- std::string old_name = it->second->Name();
- if (!it->second->SetApplicationLocale(locale, &error)) {
- LOG(ERROR) << "Error when set locale " << locale
- << " to application " << it->second->ID()
- << "error : " << error;
- }
- if (old_name != it->second->Name()) {
- // After we has changed the application locale, we might get a new name in
- // the new locale, so call all observer for this event.
- FOR_EACH_OBSERVER(
- Observer, observers_,
- OnApplicationNameChanged(it->second->ID(), it->second->Name()));
- }
- }
-}
-
Application* ApplicationService::Launch(
scoped_refptr<ApplicationData> application_data,
const Application::LaunchParams& launch_params) {
// keep track of [un]installation of applications.
class Observer {
public:
- // When we change the application locale, we might get a new name in
- // the new locale.
- virtual void OnApplicationNameChanged(const std::string& app_id,
- const std::string& app_name) {}
-
virtual void DidLaunchApplication(Application* app) {}
virtual void WillDestroyApplication(Application* app) {}
protected:
ApplicationStorage* app_storage);
virtual ~ApplicationService();
- void ChangeLocale(const std::string& locale);
-
Application* Launch(scoped_refptr<ApplicationData> application_data,
const Application::LaunchParams& launch_params);
// Launch an installed application using application id.
response_sender.Run(response.Pass());
return;
}
- if (GURL(app_id_or_url).spec().empty()) {
- CHECK(app_id_or_url == application->id());
- }
+
// FIXME(cmarcelo): ApplicationService will tell us when new applications
// appear (with DidLaunchApplication()) and we create new managed objects
// in D-Bus based on that.
const base::FilePath& application_path,
const std::string& application_id,
Manifest::SourceType source_type,
+ std::string* error) {
+ Package::Type package_type;
+ if (!GetPackageType(application_path, &package_type, error))
+ return NULL;
+
+ return LoadApplication(application_path, application_id,
+ source_type, package_type, error);
+}
+
+scoped_refptr<ApplicationData> LoadApplication(
+ const base::FilePath& application_path,
+ const std::string& application_id,
+ Manifest::SourceType source_type,
Package::Type package_type,
std::string* error) {
scoped_ptr<base::DictionaryValue> manifest(
const base::FilePath& application_root,
const std::string& application_id,
Manifest::SourceType source_type,
+ std::string* error);
+
+scoped_refptr<ApplicationData> LoadApplication(
+ const base::FilePath& application_root,
+ const std::string& application_id,
+ Manifest::SourceType source_type,
Package::Type package_type,
std::string* error);
// found in the LICENSE file.
#include "xwalk/application/common/application_storage.h"
+
+#if defined(OS_TIZEN)
+#include "xwalk/application/common/application_storage_impl_tizen.h"
+#else
#include "xwalk/application/common/application_storage_impl.h"
+#endif
namespace xwalk {
namespace application {
return impl_->GetApplicationData(app_id);
}
-bool ApplicationStorage::GetInstalledApplications(
- ApplicationData::ApplicationDataMap& apps) const { // NOLINT
- return impl_->GetInstalledApplications(apps);
-}
-
bool ApplicationStorage::GetInstalledApplicationIDs(
std::vector<std::string>& app_ids) const { // NOLINT
return impl_->GetInstalledApplicationIDs(app_ids);
scoped_refptr<ApplicationData> GetApplicationData(
const std::string& app_id) const;
- // Note: Do not use this method! It is too heavy and it will be
- // removed.
- bool GetInstalledApplications(
- ApplicationData::ApplicationDataMap& apps) const; // NOLINT
bool GetInstalledApplicationIDs(
std::vector<std::string>& app_ids) const; // NOLINT
--- /dev/null
+// Copyright (c) 2013 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.
+
+#include "xwalk/application/common/application_storage_impl_tizen.h"
+
+#include <ail.h>
+#include <pkgmgr-info.h>
+
+#include <string>
+#include <vector>
+
+#include "base/file_util.h"
+#include "third_party/re2/re2/re2.h"
+#include "xwalk/application/common/application_file_util.h"
+#include "xwalk/application/common/application_storage.h"
+#include "xwalk/application/common/id_util.h"
+
+namespace xwalk {
+namespace application {
+
+ApplicationStorageImpl::ApplicationStorageImpl(const base::FilePath& path) {
+}
+
+ApplicationStorageImpl::~ApplicationStorageImpl() {
+}
+
+bool ApplicationStorageImpl::Init() {
+ return true;
+}
+
+namespace {
+
+ail_cb_ret_e appinfo_get_exec_cb(const ail_appinfo_h appinfo, void *user_data) {
+ char* package_exec;
+ ail_appinfo_get_str(appinfo, AIL_PROP_X_SLP_EXE_PATH, &package_exec);
+ if (!package_exec)
+ return AIL_CB_RET_CONTINUE;
+
+ std::string* x_slp_exe_path = static_cast<std::string*>(user_data);
+ *x_slp_exe_path = package_exec;
+ return AIL_CB_RET_CANCEL;
+}
+
+base::FilePath GetApplicationPath(const std::string& app_id) {
+ std::string ail_id = RawAppIdToAppIdForTizenPkgmgrDB(app_id);
+ ail_filter_h filter;
+ ail_error_e ret = ail_filter_new(&filter);
+ if (ret != AIL_ERROR_OK) {
+ LOG(ERROR) << "Failed to create AIL filter.";
+ return base::FilePath();
+ }
+
+ ret = ail_filter_add_str(filter, AIL_PROP_X_SLP_APPID_STR, ail_id.c_str());
+ if (ret != AIL_ERROR_OK) {
+ LOG(ERROR) << "Failed to init AIL filter.";
+ ail_filter_destroy(filter);
+ return base::FilePath();
+ }
+
+ int count;
+ ret = ail_filter_count_appinfo(filter, &count);
+ if (ret != AIL_ERROR_OK) {
+ LOG(ERROR) << "Failed to count AIL app info.";
+ ail_filter_destroy(filter);
+ return base::FilePath();
+ }
+
+ if (count != 1) {
+ LOG(ERROR) << "Invalid count (" << count
+ << ") of the AIL DB records for the app id " << app_id;
+ ail_filter_destroy(filter);
+ return base::FilePath();
+ }
+
+ std::string x_slp_exe_path;
+ ail_filter_list_appinfo_foreach(filter, appinfo_get_exec_cb, &x_slp_exe_path);
+ ail_filter_destroy(filter);
+
+ // x_slp_exe_path is <app_path>/bin/<app_id>, we need to
+ // return just <app_path>.
+ std::string toBeExcluded = "/bin/" + app_id;
+ size_t found = x_slp_exe_path.find(toBeExcluded);
+ if (found == std::string::npos) {
+ LOG(ERROR) << "Invalid 'x_slp_exe_path' value (" << x_slp_exe_path
+ << ") for the app id " << app_id;
+ return base::FilePath();
+ }
+
+ x_slp_exe_path.resize(found);
+ return base::FilePath(x_slp_exe_path);
+}
+
+} // namespace
+
+scoped_refptr<ApplicationData> ApplicationStorageImpl::GetApplicationData(
+ const std::string& app_id) {
+ base::FilePath app_path = GetApplicationPath(app_id);
+
+ std::string error_str;
+ return LoadApplication(app_path, RawAppIdToCrosswalkAppId(app_id),
+ Manifest::INTERNAL, &error_str);
+}
+
+namespace {
+
+int pkgmgrinfo_app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data) {
+ std::vector<std::string>* app_ids =
+ static_cast<std::vector<std::string>*>(user_data);
+ char* appid = NULL;
+ pkgmgrinfo_appinfo_get_appid(handle, &appid);
+ CHECK(appid);
+
+ app_ids->push_back(TizenPkgmgrDBAppIdToRawAppId(appid));
+ return 0;
+}
+
+} // namespace
+
+bool ApplicationStorageImpl::GetInstalledApplicationIDs(
+ std::vector<std::string>& app_ids) { // NOLINT
+ pkgmgrinfo_appinfo_filter_h handle;
+ int ret = pkgmgrinfo_appinfo_filter_create(&handle);
+ if (ret != PMINFO_R_OK) {
+ LOG(ERROR) << "Failed to create pkgmgrinfo filter.";
+ return false;
+ }
+
+ ret = pkgmgrinfo_appinfo_filter_add_string(
+ handle, PMINFO_APPINFO_PROP_APP_TYPE, "webapp");
+ if (ret != PMINFO_R_OK) {
+ LOG(ERROR) << "Failed to init pkgmgrinfo filter.";
+ pkgmgrinfo_appinfo_filter_destroy(handle);
+ return false;
+ }
+
+ ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(
+ handle, pkgmgrinfo_app_list_cb, &app_ids);
+ if (ret != PMINFO_R_OK) {
+ LOG(ERROR) << "Failed to apply pkgmgrinfo filter.";
+ pkgmgrinfo_appinfo_filter_destroy(handle);
+ return false;
+ }
+ pkgmgrinfo_appinfo_filter_destroy(handle);
+
+ return true;
+}
+
+bool ApplicationStorageImpl::AddApplication(const ApplicationData* application,
+ const base::Time& install_time) {
+ return true;
+}
+
+bool ApplicationStorageImpl::UpdateApplication(
+ ApplicationData* application, const base::Time& install_time) {
+ return true;
+}
+
+bool ApplicationStorageImpl::RemoveApplication(const std::string& id) {
+ return true;
+}
+
+bool ApplicationStorageImpl::ContainsApplication(const std::string& app_id) {
+ return !GetApplicationPath(app_id).empty();
+}
+
+} // namespace application
+} // namespace xwalk
--- /dev/null
+// Copyright (c) 2013 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.
+
+#ifndef XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_IMPL_TIZEN_H_
+#define XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_IMPL_TIZEN_H_
+
+#include <set>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "base/files/file_path.h"
+#include "sql/connection.h"
+#include "sql/meta_table.h"
+#include "xwalk/application/common/application_data.h"
+
+namespace xwalk {
+namespace application {
+
+// The Sqlite backend implementation of ApplicationStorage.
+class ApplicationStorageImpl {
+ public:
+ explicit ApplicationStorageImpl(const base::FilePath& path);
+ ~ApplicationStorageImpl();
+
+ bool AddApplication(const ApplicationData* application,
+ const base::Time& install_time);
+ bool RemoveApplication(const std::string& key);
+ bool ContainsApplication(const std::string& key);
+ bool UpdateApplication(ApplicationData* application,
+ const base::Time& install_time);
+ bool Init();
+
+ scoped_refptr<ApplicationData> GetApplicationData(const std::string& id);
+
+ bool GetInstalledApplicationIDs(
+ std::vector<std::string>& app_ids); // NOLINT
+};
+
+} // namespace application
+} // namespace xwalk
+
+#endif // XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_IMPL_TIZEN_H_
return kAppIdPrefix + id;
}
+std::string TizenPkgmgrDBAppIdToRawAppId(const std::string& id) {
+ std::string raw_id;
+ if (RE2::FullMatch(id, "xwalk.(\\w+)", &raw_id))
+ return raw_id;
+ return id;
+}
+
std::string GetTizenAppId(ApplicationData* application) {
if (application->GetPackageType() == xwalk::application::Package::XPK)
return application->ID();
// for xpk, but it must be an "." on appid or it cannot insert to tizen pkgmgr
// db, so we have to have a "xwalk." as it's prefix.
std::string RawAppIdToAppIdForTizenPkgmgrDB(const std::string& id);
+// Does the opposite to the above function.
+std::string TizenPkgmgrDBAppIdToRawAppId(const std::string& id);
// For xpk, app_id == crosswalk_32bytes_app_id == this->ID(),
// For wgt, app_id == tizen_wrt_10bytes_package_id.app_name,
--- /dev/null
+// Copyright (c) 2013 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.
+
+#ifndef XWALK_APPLICATION_COMMON_INSTALLER_SIGNATURE_DATA_H_
+#define XWALK_APPLICATION_COMMON_INSTALLER_SIGNATURE_DATA_H_
+
+#include <list>
+#include <set>
+#include <string>
+
+#include "base/files/file_path.h"
+#include "libxml/tree.h"
+#include "libxml/xpath.h"
+#include "xwalk/application/common/signature_types.h"
+
+namespace xwalk {
+namespace application {
+
+class SignatureData {
+ public:
+ SignatureData(const std::string& signature_file_name, int signature_number)
+ : signature_file_name_(signature_file_name),
+ signature_number_(signature_number) {
+ }
+
+ std::string signature_file_name() const {
+ return signature_file_name_;
+ }
+
+ std::set<std::string>& reference_set() {
+ return reference_set_;
+ }
+
+ void set_reference_set(const std::set<std::string>& reference_set) {
+ reference_set_ = reference_set;
+ }
+
+ std::string role_uri() const {
+ return role_uri_;
+ }
+
+ void set_role_uri(const std::string& role_uri) {
+ role_uri_ = role_uri;
+ }
+
+ std::string profile_uri() const {
+ return profile_uri_;
+ }
+
+ void set_profile_uri(const std::string& profile_uri) {
+ profile_uri_ = profile_uri;
+ }
+
+ std::string object_id() const {
+ return object_id_;
+ }
+
+ void set_object_id(const std::string& object_id) {
+ object_id_ = object_id;
+ }
+
+ std::string signature_value() const {
+ return signature_value_;
+ }
+
+ void set_signature_value(const std::string& signature_value) {
+ signature_value_ = signature_value;
+ }
+
+ std::string canonicalization_method() const {
+ return canonicalization_method_;
+ }
+
+ void set_canonicalization_method(const std::string& canonicalization_method) {
+ canonicalization_method_ = canonicalization_method;
+ }
+
+ std::string signature_method() const {
+ return signature_method_;
+ }
+
+ void set_signature_method(const std::string signature_method) {
+ signature_method_ = signature_method;
+ }
+
+ std::list<std::string>& certificate_list() {
+ return certificate_list_;
+ }
+
+ void set_certificate_list(const std::list<std::string>& certificate_list) {
+ certificate_list_ = certificate_list;
+ }
+
+ ReferenceHashMap& reference_hash_map() {
+ return reference_hash_map_;
+ }
+
+ void set_reference_hash_map(const ReferenceHashMap& reference_hash_map) {
+ reference_hash_map_ = reference_hash_map;
+ }
+
+ bool isAuthorSignature() const {
+ return signature_number_ == -1;
+ }
+
+ private:
+ std::string signature_file_name_;
+ // This number is taken from distributor signature file name.
+ // Author signature do not contain any number on the file name.
+ // Author signature should have signature number equal to -1.
+ int signature_number_;
+ std::string role_uri_;
+ std::string profile_uri_;
+ std::string signature_value_;
+ std::string identifier;
+ std::string object_id_;
+ std::string canonicalization_method_;
+ std::string signature_method_;
+ std::set<std::string> reference_set_;
+ std::list<std::string> certificate_list_;
+ ReferenceHashMap reference_hash_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(SignatureData);
+};
+
+} // namespace application
+} // namespace xwalk
+
+#endif // XWALK_APPLICATION_COMMON_INSTALLER_SIGNATURE_DATA_H_
--- /dev/null
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright (c) 2014 Intel Corporation.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "xwalk/application/common/installer/signature_parser.h"
+
+#include <list>
+#include <set>
+#include <string>
+#include <utility>
+#include <vector>
+#include "base/file_util.h"
+#include "base/logging.h"
+#include "libxml/parser.h"
+#include "libxml/xmlschemas.h"
+#include "libxml/xpathInternals.h"
+#include "libxml/xmlreader.h"
+#include "third_party/libxml/chromium/libxml_utils.h"
+
+namespace {
+const char kExpectedXmlns[] = "http://www.w3.org/2000/09/xmldsig#";
+// TAG TOKENS
+const char kTokenSignature[] = "Signature";
+const char kTokenSignedInfo[] = "SignedInfo";
+const char kTokenCanonicalizationMethod[] = "CanonicalizationMethod";
+const char kTokenSignatureMethod[] = "SignatureMethod";
+const char kTokenReference[] = "Reference";
+const char kTokenTransforms[] = "Transforms";
+const char kTokenTransform[] = "Transform";
+const char kTokenDigestMethod[] = "DigestMethod";
+const char kTokenDigestValue[] = "DigestValue";
+const char kTokenSignatureValue[] = "SignatureValue";
+const char kTokenkeyInfo[] = "KeyInfo";
+const char kTokenX509Data[] = "X509Data";
+const char kTokenX509Certificate[] = "X509Certificate";
+const char kTokenObject[] = "Object";
+const char kTokenSignatureProperties[] = "SignatureProperties";
+const char kTokenSignatureProperty[] = "SignatureProperty";
+
+// ATTRIBUTE TOKENS
+const char kTokenAlgorithm[] = "Algorithm";
+const char kTokenURI[] = "URI";
+const char kTokenID[] = "Id";
+
+// ATTRIBUTE VALUES
+const char kTokenAttrProfile[] = "profile";
+const char kTokenAttrRole[] = "role";
+const char kTokenAttrIdentifier[] = "identifier";
+
+bool TagNameEquals(const xmlNodePtr node,
+ const char* expected_name, const xmlNsPtr expected_namespace) {
+ if (node->ns != expected_namespace)
+ return false;
+
+ return 0 == strcmp(expected_name, reinterpret_cast<const char*>(node->name));
+}
+
+// Returns child nodes of |root| with name |name|.
+std::vector<xmlNodePtr> GetChildren(
+ const xmlNodePtr root, const xmlNsPtr xml_namespace, const char* name) {
+ std::vector<xmlNodePtr> result;
+ for (xmlNodePtr child = root->children; child != NULL; child = child->next) {
+ if (!TagNameEquals(child, name, xml_namespace))
+ continue;
+
+ result.push_back(child);
+ }
+ return result;
+}
+
+// Returns the first child node of |root| with name |name|.
+xmlNodePtr GetFirstChild(
+ const xmlNodePtr root, const xmlNsPtr xml_namespace, const char* name) {
+ xmlNodePtr result = NULL;
+ for (xmlNodePtr child = root->children; child != NULL; child = child->next) {
+ if (TagNameEquals(child, name, xml_namespace)) {
+ result = child;
+ break;
+ }
+ }
+ return result;
+}
+
+// Returns the value of a named attribute, or the empty string.
+std::string GetAttribute(
+ const xmlNodePtr node, const char* attribute_name) {
+ const xmlChar* name =
+ reinterpret_cast<const xmlChar*>(attribute_name);
+ for (xmlAttr* attr = node->properties; attr != NULL; attr = attr->next) {
+ if (!xmlStrcmp(attr->name, name) && attr->children &&
+ attr->children->content)
+ return std::string(reinterpret_cast<const char*>(
+ attr->children->content));
+ }
+ return std::string();
+}
+
+// Returns a pointer to the xmlNs on |node| with the |expected_href|, or
+// NULL if there isn't one with that href.
+xmlNsPtr GetNamespace(const xmlNodePtr node, const char* expected_href) {
+ const xmlChar* href = reinterpret_cast<const xmlChar*>(expected_href);
+ for (xmlNsPtr ns = node->ns; ns != NULL; ns = ns->next) {
+ if (ns->href && !xmlStrcmp(ns->href, href))
+ return ns;
+ }
+ return NULL;
+}
+
+} // namespace
+
+namespace xwalk {
+namespace application {
+bool ParseSignedInfoElement(
+ const xmlNodePtr node, const xmlNsPtr signature_ns, SignatureData* data) {
+ xmlNodePtr signed_info_node =
+ GetFirstChild(node, signature_ns, kTokenSignedInfo);
+ if (!signed_info_node) {
+ LOG(ERROR) << "Missing SignedInfo tag.";
+ return false;
+ }
+
+ // Parse <CanonicalizationMethod>
+ xmlNodePtr canonicalization_method_node =
+ GetFirstChild(signed_info_node, signature_ns, kTokenCanonicalizationMethod);
+ if (!canonicalization_method_node) {
+ LOG(ERROR) << "Missing SignedInfo tag.";
+ return false;
+ }
+ std::string canonicalization_method =
+ GetAttribute(canonicalization_method_node, kTokenAlgorithm);
+ data->set_canonicalization_method(canonicalization_method);
+
+ // Parse <SignatureMethod>
+ xmlNodePtr signature_method_node =
+ GetFirstChild(signed_info_node, signature_ns, kTokenSignatureMethod);
+ if (!signature_method_node) {
+ LOG(ERROR) << "Missing SignatureMethod tag.";
+ return false;
+ }
+ std::string signature_method =
+ GetAttribute(signature_method_node, kTokenAlgorithm);
+ data->set_signature_method(signature_method);
+
+ // Parse <Reference>
+ std::vector<xmlNodePtr> reference_vec =
+ GetChildren(signed_info_node, signature_ns, kTokenReference);
+ if (reference_vec.empty()) {
+ LOG(ERROR) << "Missing Reference tag.";
+ return false;
+ }
+
+ std::string uri, transform_algorithm, digest_method, digest_value;
+ xmlNodePtr refer_node, transforms_node, transform_node, digest_method_node,
+ digest_value_node;
+ ReferenceData reference_data;
+ std::set<std::string> reference_set;
+ ReferenceHashMap reference_hash_map;
+ for (int i = 0; i < reference_vec.size(); ++i) {
+ refer_node = reference_vec[i];
+ uri = GetAttribute(refer_node, kTokenURI);
+ if (uri.empty()) {
+ LOG(ERROR) << "Missing URI attribute.";
+ return false;
+ }
+ reference_set.insert(uri);
+
+ // Parse <Transforms>
+ transforms_node =
+ GetFirstChild(refer_node, signature_ns, kTokenTransforms);
+ if (!transforms_node) {
+ transform_node =
+ GetFirstChild(transforms_node, signature_ns, kTokenTransform);
+ if (!transforms_node) {
+ reference_data.transform_algorithm =
+ GetAttribute(transform_node, kTokenAlgorithm);
+ }
+ }
+
+ // Parse <DigestMethod>
+ digest_method_node =
+ GetFirstChild(refer_node, signature_ns, kTokenDigestMethod);
+ if (!digest_method_node) {
+ LOG(ERROR) << "Missing DigestMethod tag.";
+ return false;
+ }
+ reference_data.digest_method =
+ GetAttribute(digest_method_node, kTokenAlgorithm);
+ if (reference_data.digest_method.empty()) {
+ LOG(ERROR) << "Missing DigestMethod attribute.";
+ return false;
+ }
+
+ // Parser <DigestValue>
+ digest_value_node =
+ GetFirstChild(refer_node, signature_ns, kTokenDigestValue);
+ if (!digest_value_node) {
+ LOG(ERROR) << "Missing DigestValue tag.";
+ return false;
+ }
+ reference_data.digest_value =
+ XmlStringToStdString(xmlNodeGetContent(digest_value_node));
+ if (reference_data.digest_value.empty()) {
+ LOG(ERROR) << "Missing DigestValue.";
+ return false;
+ }
+ reference_hash_map.insert(make_pair(uri, reference_data));
+ }
+ data->set_reference_set(reference_set);
+ data->set_reference_hash_map(reference_hash_map);
+
+ return true;
+}
+
+bool ParseSignatureValueElement(
+ const xmlNodePtr node, const xmlNsPtr ns, SignatureData* data) {
+ xmlNodePtr sign_value_node = GetFirstChild(node, ns, kTokenSignatureValue);
+ if (!sign_value_node) {
+ LOG(ERROR) << "Missing SignatureValue tag.";
+ return false;
+ }
+ std::string signature_value = XmlStringToStdString(
+ xmlNodeGetContent(sign_value_node));
+ data->set_signature_value(signature_value);
+ return true;
+}
+
+bool ParseKeyInfoElement(
+ const xmlNodePtr node, const xmlNsPtr ns, SignatureData* data) {
+ xmlNodePtr key_info_node = GetFirstChild(node, ns, kTokenkeyInfo);
+ if (!key_info_node) {
+ LOG(INFO) << "Missing KeyInfo tag, it is allowed by schema.xsd.";
+ return true;
+ }
+
+ // KeyInfo may contain keys, names, certificates and other public key
+ // management. Now I only handle X509 certifcates which is commonly used.
+ // TODO(Xu): Other types of element
+ xmlNodePtr X509_data_node =
+ GetFirstChild(key_info_node, ns, kTokenX509Data);
+ if (!X509_data_node) {
+ LOG(INFO) << "Missing X509Data tag.";
+ return true;
+ }
+
+ // Parse <X509Certificate>
+ std::vector<xmlNodePtr> cert_vec =
+ GetChildren(X509_data_node, ns, kTokenX509Certificate);
+ if (cert_vec.empty()) {
+ LOG(ERROR) << "Missing X509Certificate tag.";
+ return false;
+ }
+
+ std::list<std::string> certificate_list;
+ for (std::vector<xmlNode*>::iterator it = cert_vec.begin();
+ it != cert_vec.end(); ++it) {
+ xmlNodePtr certificate_node = *it;
+ certificate_list.push_back(
+ XmlStringToStdString(xmlNodeGetContent(certificate_node)));
+ }
+ data->set_certificate_list(certificate_list);
+ return true;
+}
+
+bool ParseObjectElement(
+ const xmlNodePtr node, const xmlNsPtr ns, SignatureData* data) {
+ xmlNodePtr object_node = GetFirstChild(node, ns, kTokenObject);
+ if (!object_node) {
+ LOG(ERROR) << "Missing Object tag.";
+ return false;
+ }
+
+ std::string object_id = GetAttribute(object_node, kTokenID);
+ data->set_object_id(object_id);
+ // Parse <SignatureProperties>
+ xmlNodePtr properties_node =
+ GetFirstChild(object_node, ns, kTokenSignatureProperties);
+ if (!properties_node) {
+ LOG(ERROR) << "Missing Object tag.";
+ return false;
+ }
+
+ std::vector<xmlNodePtr> prop_vec =
+ GetChildren(properties_node, ns, kTokenSignatureProperty);
+ std::string Id, uri, element_name, profile_uri, role_uri;
+ xmlNodePtr sign_property_node, child;
+ for (int i = 0; i < prop_vec.size(); i++) {
+ sign_property_node = prop_vec[i];
+ Id = GetAttribute(sign_property_node, kTokenID);
+ child = sign_property_node->children;
+ if (!child) {
+ LOG(ERROR) << "Failing to find " << element_name
+ << " element.";
+ return false;
+ }
+
+ if (Id.compare(kTokenAttrProfile) == 0) {
+ profile_uri = GetAttribute(child, kTokenURI);
+ data->set_profile_uri(profile_uri);
+ }
+ if (Id.compare(kTokenAttrRole) == 0) {
+ role_uri = GetAttribute(child, kTokenURI);
+ data->set_role_uri(role_uri);
+ }
+ }
+
+ return true;
+}
+
+bool ParseXML(xmlDocPtr docPtr, SignatureData* data) {
+ xmlNodePtr root = xmlDocGetRootElement(docPtr);
+ if (!root) {
+ LOG(ERROR) << "Missinging root node.";
+ return false;
+ }
+
+ // Look for the required namespace declaration.
+ xmlNsPtr signature_ns = GetNamespace(root, kExpectedXmlns);
+ if (!signature_ns) {
+ LOG(ERROR) << "Missinging or incorrect xmlns on signature tag.";
+ return false;
+ }
+ if (!TagNameEquals(root, kTokenSignature, signature_ns)) {
+ LOG(ERROR) << "Missinging Signature tag.";
+ return false;
+ }
+
+ if (!ParseSignedInfoElement(root, signature_ns, data))
+ return false;
+
+ if (!ParseSignatureValueElement(root, signature_ns, data))
+ return false;
+
+ if (!ParseKeyInfoElement(root, signature_ns, data))
+ return false;
+
+ if (!ParseObjectElement(root, signature_ns, data))
+ return false;
+
+ return true;
+}
+
+// static
+scoped_ptr<SignatureData> SignatureParser::CreateSignatureData(
+ const base::FilePath& signature_path, int signature_number) {
+ std::string file_name = signature_path.MaybeAsASCII();
+ scoped_ptr<SignatureData>
+ data(new SignatureData(file_name, signature_number));
+
+ xmlInitParser();
+ xmlDocPtr doc = xmlParseFile(file_name.c_str());
+ if (!doc) {
+ LOG(ERROR) << "Opening signature " << file_name << " failed.";
+ return scoped_ptr<SignatureData>();
+ }
+
+ if (!ParseXML(doc, data.get())) {
+ LOG(ERROR) << "Parsering failed.";
+ xmlFreeDoc(doc);
+ return scoped_ptr<SignatureData>();
+ }
+
+ xmlFreeDoc(doc);
+ xmlCleanupParser();
+ return data.Pass();
+}
+} // namespace application
+} // namespace xwalk
--- /dev/null
+// Copyright (c) 2013 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.
+
+#ifndef XWALK_APPLICATION_COMMON_INSTALLER_SIGNATURE_PARSER_H_
+#define XWALK_APPLICATION_COMMON_INSTALLER_SIGNATURE_PARSER_H_
+
+#include "base/files/file_path.h"
+#include "base/memory/scoped_ptr.h"
+#include "xwalk/application/common/installer/signature_data.h"
+
+namespace xwalk {
+namespace application {
+
+class SignatureParser {
+ public:
+ static scoped_ptr<SignatureData> CreateSignatureData(
+ const base::FilePath& signature_path, int signature_number);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SignatureParser);
+};
+
+} // namespace application
+} // namespace xwalk
+
+#endif // XWALK_APPLICATION_COMMON_INSTALLER_SIGNATURE_PARSER_H_
--- /dev/null
+// Copyright (c) 2013 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.
+
+#ifndef XWALK_APPLICATION_COMMON_SIGNATURE_TYPES_H_
+#define XWALK_APPLICATION_COMMON_SIGNATURE_TYPES_H_
+
+#include <map>
+#include <string>
+
+namespace xwalk {
+namespace application {
+
+struct ReferenceData {
+ std::string transform_algorithm;
+ std::string digest_method;
+ std::string digest_value;
+};
+
+typedef std::map<std::string, ReferenceData> ReferenceHashMap;
+} // namespace application
+} // namespace xwalk
+
+#endif // XWALK_APPLICATION_COMMON_SIGNATURE_TYPES_H_
'sources': [
'application_storage.cc',
'application_storage.h',
- 'application_storage_impl.cc',
- 'application_storage_impl.h',
'application_data.cc',
'application_data.h',
'permission_policy_manager.cc',
'permission_policy_manager.h',
'permission_types.h',
+ 'signature_types.h',
'installer/package.h',
'installer/package.cc',
'installer/package_installer.cc',
'installer/package_installer.h',
+ 'installer/signature_data.h',
+ 'installer/signature_parser.h',
+ 'installer/signature_parser.cc',
'installer/wgt_package.h',
'installer/wgt_package.cc',
'installer/xpk_package.cc',
'../../../third_party/re2/re2.gyp:re2',
],
'sources': [
+ 'application_storage_impl_tizen.cc',
+ 'application_storage_impl_tizen.h',
'manifest_handlers/navigation_handler.cc',
'manifest_handlers/navigation_handler.h',
'manifest_handlers/tizen_application_handler.cc',
'installer/tizen/packageinfo_constants.cc',
'installer/tizen/packageinfo_constants.h',
],
+ }, {
+ 'sources': [
+ 'application_storage_impl.cc',
+ 'application_storage_impl.h',
+ ]
}],
],
'include_dirs': [
#include "xwalk/application/tools/linux/dbus_connection.h"
#include "xwalk/application/tools/linux/xwalk_extension_process_launcher.h"
#if defined(OS_TIZEN)
-#include "xwalk/application/common/id_util.h"
+#include "url/gurl.h"
#include "xwalk/application/tools/linux/xwalk_launcher_tizen.h"
#include "xwalk/application/tools/linux/xwalk_tizen_user.h"
#endif
appid_or_url = strdup(basename(argv[0]));
}
-#if defined(OS_TIZEN)
- std::string crosswalk_app_id =
- xwalk::application::RawAppIdToCrosswalkAppId(appid_or_url);
- appid_or_url = strdup(crosswalk_app_id.c_str());
-#endif
// Query app.
if (query_running) {
#endif
bool list_applications(ApplicationStorage* storage) {
- ApplicationData::ApplicationDataMap apps;
- if (!storage->GetInstalledApplications(apps))
+ std::vector<std::string> app_ids;
+ if (!storage->GetInstalledApplicationIDs(app_ids))
return false;
g_print("Application ID Application Name\n");
g_print("-----------------------------------------------------\n");
- ApplicationData::ApplicationDataMap::const_iterator it;
- for (it = apps.begin(); it != apps.end(); ++it) {
+ for (unsigned i = 0; i < app_ids.size(); ++i) {
+ scoped_refptr<ApplicationData> app_data =
+ storage->GetApplicationData(app_ids.at(i));
+ if (!app_data) {
+ g_print("Failed to obtain app data for xwalk id: %s\n",
+ app_ids.at(i).c_str());
+ continue;
+ }
#if defined(OS_TIZEN)
g_print("%s %s\n",
- GetTizenAppId(it->second).c_str(),
- it->second->Name().c_str());
+ GetTizenAppId(app_data).c_str(),
+ app_data->Name().c_str());
#else
- g_print("%s %s\n", it->first.c_str(), it->second->Name().c_str());
+ g_print("%s %s\n", app_data->ID().c_str(), app_data->Name().c_str());
#endif
}
g_print("-----------------------------------------------------\n");
'type': 'none',
'variables': {
'packages': [
+ 'ail',
'dlog',
'pkgmgr-parser',
'pkgmgr-info',
DBusManager::DBusManager() {}
DBusManager::~DBusManager() {
- if (session_bus_)
+ if (session_bus_.get())
session_bus_->ShutdownOnDBusThreadAndBlock();
}
scoped_refptr<dbus::Bus> DBusManager::session_bus() {
- if (!session_bus_) {
+ if (!session_bus_.get()) {
base::Thread::Options thread_options;
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
std::string thread_name = "Crosswalk D-Bus thread";
base::FilePath::FromUTF8Unsafe(
std::string(tzplatform_getenv(dirs[i])));
}
-
- virtual_root_map_["RINGTONES"] =
- base::FilePath::FromUTF8Unsafe(
- std::string(tzplatform_mkpath(TZ_USER_SHARE, "settings/Ringtones")));
}
#if defined(OS_LINUX)
std::string channel_id =
IPC::Channel::GenerateVerifiedChannelID(std::string());
- channel_ = IPC::Channel::CreateClient(channel_id, this);
+ channel_ = IPC::Channel::CreateServer(channel_id, this);
if (!channel_->Connect())
NOTREACHED();
IPC::ChannelHandle channel_handle(channel_id,
// Useful values might be "valgrind" or "xterm -e gdb --args".
const char kXWalkExtensionCmdPrefix[] = "xwalk-extension-cmd-prefix";
+// Disable XWalkExtensionSystem and all extensions only for Android OS
+const char kXWalkDisableExtensions[] = "disable-xwalk-extensions";
+
} // namespace switches
extern const char kXWalkExtensionProcess[];
extern const char kXWalkExternalExtensionsPath[];
extern const char kXWalkExtensionCmdPrefix[];
+extern const char kXWalkDisableExtensions[];
} // namespace switches
+++ /dev/null
-Author: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
-
-Angle : Do not use .git/index as a dependency. Tizen is built by packing
-everything in a tarball where there is no .git/ directory.
-
-This has been fixed upstream already :
-http://code.google.com/p/chromium/issues/detail?id=395705
-
-diff --git src/third_party/angle/src/angle.gypi src/third_party/angle/src/angle.gypi
-index 5339369..c7ef8c1 100644
---- src/third_party/angle/src/angle.gypi
-+++ src/third_party/angle/src/angle.gypi
-@@ -56,7 +56,7 @@
- {
- 'action_name': 'Generate Commit ID Header',
- 'message': 'Generating commit ID header...',
-- 'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.py', '<(angle_path)/.git/index' ],
-+ 'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.py' ],
- 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
- 'action': [ 'python', '<(SHARED_INTERMEDIATE_DIR)/commit_id.py', '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
- },
%endif
Name: crosswalk
-Version: 8.37.180.0
+Version: 8.37.183.0
Release: 0
Summary: Crosswalk is an app runtime based on Chromium
License: (BSD-3-Clause and LGPL-2.1+)
Source1003: %{name}.png
Patch9: Blink-Add-GCC-flag-Wno-narrowing-fix-64bits-build.patch
Patch10: crosswalk-do-not-look-for-gtk-dependencies-on-x11.patch
-Patch11: crosswalk-angle-do-not-depend-git-index.patch
BuildRequires: bison
BuildRequires: bzip2-devel
BuildRequires: python-xml
BuildRequires: perl
BuildRequires: which
+BuildRequires: pkgconfig(ail)
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(appcore-common)
BuildRequires: pkgconfig(cairo)
%patch10
%endif
-%patch11
-
%build
# For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
import java.net.URLConnection;
import java.util.List;
-import org.chromium.base.CalledByNativeUnchecked;
+import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
/**
* @param url The url to load.
* @return An InputStream to the Android resource.
*/
- // TODO(bulach): this should have either a throw clause, or
- // handle the exception in the java side rather than the native side.
- @CalledByNativeUnchecked
+ @CalledByNative
public static InputStream open(Context context, String url) {
Uri uri = verifyUrl(url);
if (uri == null) {
return null;
}
- String path = uri.getPath();
- if (uri.getScheme().equals(FILE_SCHEME)) {
- if (path.startsWith(nativeGetAndroidAssetPath())) {
- return openAsset(context, uri);
- } else if (path.startsWith(nativeGetAndroidResourcePath())) {
- return openResource(context, uri);
- }
- } else if (uri.getScheme().equals(CONTENT_SCHEME)) {
- return openContent(context, uri);
- } else if (uri.getScheme().equals(APP_SCHEME)) {
- // The host should be the same as the lower case of the package
- // name, otherwise the resource request should be rejected.
- if (!uri.getHost().equals(context.getPackageName().toLowerCase())) return null;
+ try {
+ String path = uri.getPath();
+ if (uri.getScheme().equals(FILE_SCHEME)) {
+ if (path.startsWith(nativeGetAndroidAssetPath())) {
+ return openAsset(context, uri);
+ } else if (path.startsWith(nativeGetAndroidResourcePath())) {
+ return openResource(context, uri);
+ }
+ } else if (uri.getScheme().equals(CONTENT_SCHEME)) {
+ return openContent(context, uri);
+ } else if (uri.getScheme().equals(APP_SCHEME)) {
+ // The host should be the same as the lower case of the package
+ // name, otherwise the resource request should be rejected.
+ if (!uri.getHost().equals(context.getPackageName().toLowerCase())) return null;
- // path == "/" or path == ""
- if (path.length() <= 1) return null;
+ // path == "/" or path == ""
+ if (path.length() <= 1) return null;
- return openAsset(context, appUriToFileUri(uri));
+ return openAsset(context, appUriToFileUri(uri));
+ }
+ } catch (Exception ex) {
+ Log.e(TAG, "Error opening inputstream: " + url);
}
return null;
return id;
}
- private static int getValueType(Context context, int field_id) {
- TypedValue value = new TypedValue();
- context.getResources().getValue(field_id, value, true);
- return value.type;
+ private static int getValueType(Context context, int fieldId) {
+ TypedValue value = new TypedValue();
+ context.getResources().getValue(fieldId, value, true);
+ return value.type;
}
private static InputStream openResource(Context context, Uri uri) {
- assert(uri.getScheme().equals(FILE_SCHEME));
- assert(uri.getPath() != null);
- assert(uri.getPath().startsWith(nativeGetAndroidResourcePath()));
+ assert uri.getScheme().equals(FILE_SCHEME);
+ assert uri.getPath() != null;
+ assert uri.getPath().startsWith(nativeGetAndroidResourcePath());
// The path must be of the form "/android_res/asset_type/asset_name.ext".
List<String> pathSegments = uri.getPathSegments();
if (pathSegments.size() != 3) {
if (context.getApplicationContext() != null) {
context = context.getApplicationContext();
}
- int field_id = getFieldId(context, assetType, assetName);
- int value_type = getValueType(context, field_id);
- if (value_type == TypedValue.TYPE_STRING) {
- return context.getResources().openRawResource(field_id);
+ int fieldId = getFieldId(context, assetType, assetName);
+ int valueType = getValueType(context, fieldId);
+ if (valueType == TypedValue.TYPE_STRING) {
+ return context.getResources().openRawResource(fieldId);
} else {
Log.e(TAG, "Asset not of type string: " + uri);
return null;
}
private static InputStream openAsset(Context context, Uri uri) {
+ 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(getAssetPath(uri), AssetManager.ACCESS_STREAMING);
+ return assets.open(path, AssetManager.ACCESS_STREAMING);
} catch (IOException e) {
Log.e(TAG, "Unable to open asset URL: " + uri);
return null;
* @param url The url from which the stream was opened.
* @return The mime type or null if the type is unknown.
*/
- // TODO(bulach): this should have either a throw clause, or
- // handle the exception in the java side rather than the native side.
- @CalledByNativeUnchecked
+ @CalledByNative
public static String getMimeType(Context context, InputStream stream, String url) {
Uri uri = verifyUrl(url);
if (uri == null) {
return null;
}
- String path = uri.getPath();
- // The content URL type can be queried directly.
- if (uri.getScheme().equals(CONTENT_SCHEME)) {
- return context.getContentResolver().getType(uri);
- // Asset files may have a known extension.
- } else if (uri.getScheme().equals(APP_SCHEME) ||
- uri.getScheme().equals(FILE_SCHEME) &&
- path.startsWith(nativeGetAndroidAssetPath())) {
- String mimeType = URLConnection.guessContentTypeFromName(path);
- if (mimeType != null) {
- return mimeType;
+ try {
+ String path = uri.getPath();
+ // The content URL type can be queried directly.
+ if (uri.getScheme().equals(CONTENT_SCHEME)) {
+ return context.getContentResolver().getType(uri);
+ // Asset files may have a known extension.
+ } else if (uri.getScheme().equals(FILE_SCHEME) &&
+ path.startsWith(nativeGetAndroidAssetPath())) {
+ String mimeType = URLConnection.guessContentTypeFromName(path);
+ if (mimeType != null) {
+ return mimeType;
+ }
}
+ } catch (Exception ex) {
+ Log.e(TAG, "Unable to get mime type" + url);
+ return null;
}
// Fall back to sniffing the type from the stream.
try {
* @param context The context manager.
* @return Package name.
*/
- @CalledByNativeUnchecked
+ @CalledByNative
public static String getPackageName(Context context) {
- // Make sure the context is the application context.
- // Or it will get the wrong package name in shared mode.
- return context.getPackageName();
+ try {
+ // Make sure the context is the application context.
+ // Or it will get the wrong package name in shared mode.
+ return context.getPackageName();
+ } catch (Exception ex) {
+ Log.e(TAG, "Unable to get package name");
+ return null;
+ }
}
/**
import org.chromium.base.ActivityState;
import org.chromium.base.ApplicationStatus;
import org.chromium.base.ApplicationStatus.ActivityStateListener;
+import org.chromium.base.CommandLine;
import org.xwalk.core.internal.extension.XWalkExtensionManager;
import org.xwalk.core.internal.extension.XWalkPathHelper;
setNavigationHandler(new XWalkNavigationHandlerImpl(context));
setNotificationService(new XWalkNotificationServiceImpl(context, this));
- // Enable xwalk extension mechanism and start load extensions here.
- // Note that it has to be after above initialization.
- mExtensionManager = new XWalkExtensionManager(context, getActivity());
- mExtensionManager.loadExtensions();
+ if (!CommandLine.getInstance().hasSwitch("disable-xwalk-extensions")) {
+ // Enable xwalk extension mechanism and start load extensions here.
+ // Note that it has to be after above initialization.
+ mExtensionManager = new XWalkExtensionManager(context, getActivity());
+ mExtensionManager.loadExtensions();
+ }
XWalkPathHelper.initialize();
XWalkPathHelper.setCacheDirectory(
*/
public void onHide() {
if (mContent == null || mIsHidden) return;
- mExtensionManager.onPause();
+ if (null != mExtensionManager) mExtensionManager.onPause();
mContent.onPause();
mIsHidden = true;
}
*/
public void onShow() {
if (mContent == null || !mIsHidden ) return;
- mExtensionManager.onResume();
+ if (null != mExtensionManager) mExtensionManager.onResume();
mContent.onResume();
mIsHidden = false;
}
*/
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (mContent == null) return;
- mExtensionManager.onActivityResult(requestCode, resultCode, data);
+ if (null != mExtensionManager)
+ mExtensionManager.onActivityResult(requestCode, resultCode, data);
mContent.onActivityResult(requestCode, resultCode, data);
}
if (mContent == null) return;
ApplicationStatus.unregisterActivityStateListener(mActivityStateListener);
mActivityStateListener = null;
- mExtensionManager.onDestroy();
+ if (null != mExtensionManager) mExtensionManager.onDestroy();
mContent.destroy();
disableRemoteDebugging();
}
return;
}
- if (msg.data && msg.data.error) {
- g_async_calls[msg.asyncCallId].reject(msg.data.error);
+ if (msg.data) {
+ if (!msg.data.hasOwnProperty("error") || !msg.data.error) {
+ g_async_calls[msg.asyncCallId].resolve(msg.data);
+ } else {
+ g_async_calls[msg.asyncCallId].reject(msg.data);
+ }
} else {
- g_async_calls[msg.asyncCallId].resolve(msg.data);
+ console.log("WARNING: Message from backend doesn't have data.")
+ g_async_calls[msg.asyncCallId].resolve();
}
delete g_async_calls[msg.asyncCallId];
<category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
</intent-filter>
</activity>
+ <provider android:name="org.xwalk.core.internal.xwview.test.TestContentProvider"
+ android:authorities="org.xwalk.core.internal.xwview.test.TestContentProvider" />
</application>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
CreateStreamReader(input_stream.get()));
DCHECK(input_stream_reader);
- DCHECK(!input_stream_reader_wrapper_);
+ DCHECK(!input_stream_reader_wrapper_.get());
input_stream_reader_wrapper_ = new InputStreamReaderWrapper(
input_stream.Pass(), input_stream_reader.Pass());
int dest_size,
int* bytes_read) {
DCHECK(thread_checker_.CalledOnValidThread());
- if (!input_stream_reader_wrapper_) {
+ if (!input_stream_reader_wrapper_.get()) {
// This will happen if opening the InputStream fails in which case the
// error is communicated by setting the HTTP response status header rather
// than failing the request during the header fetch phase.
JNIEnv* env = AttachCurrentThread();
DCHECK(env);
- if (!input_stream_reader_wrapper_)
+ if (!input_stream_reader_wrapper_.get())
return false;
// Since it's possible for this call to alter the InputStream a
JNIEnv* env = AttachCurrentThread();
DCHECK(env);
- if (!input_stream_reader_wrapper_)
+ if (!input_stream_reader_wrapper_.get())
return false;
// Since it's possible for this call to alter the InputStream a
virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) OVERRIDE;
virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) OVERRIDE;
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
private:
JavaObjectWeakGlobalRef jdelegate_;
RfhToIoThreadClientMap::GetInstance()->Erase(GetRenderFrameHostIdPair(rfh));
}
-void ClientMapEntryUpdater::WebContentsDestroyed(WebContents* web_contents) {
+void ClientMapEntryUpdater::WebContentsDestroyed() {
delete this;
}
+++ /dev/null
-// Copyright (c) 2013 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.
-
-#include "base/command_line.h"
-#include "base/file_util.h"
-#include "base/path_service.h"
-#include "base/strings/string_util.h"
-#include "base/strings/utf_string_conversions.h"
-#include "xwalk/runtime/browser/runtime.h"
-#include "xwalk/runtime/common/xwalk_notification_types.h"
-#include "xwalk/test/base/in_process_browser_test.h"
-#include "xwalk/test/base/xwalk_test_utils.h"
-#include "content/public/browser/navigation_controller.h"
-#include "content/public/browser/navigation_entry.h"
-#include "content/public/browser/notification_details.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
-#include "content/public/browser/notification_service.h"
-#include "content/public/browser/notification_source.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/test/browser_test_utils.h"
-#include "content/public/test/test_utils.h"
-#include "net/base/net_util.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-using xwalk::NativeAppWindow;
-using xwalk::Runtime;
-using content::WebContents;
-using testing::_;
-
-class XWalkRuntimeTest : public InProcessBrowserTest {
- public:
- XWalkRuntimeTest() {}
- virtual ~XWalkRuntimeTest() {
- original_runtimes_.clear();
- notification_observer_.reset();
- }
-
- // SetUpOnMainThread is called after BrowserMainRunner was initialized and
- // just before RunTestOnMainThread (aka. TestBody).
- virtual void SetUpOnMainThread() OVERRIDE {
- notification_observer_.reset(
- new content::WindowedNotificationObserver(
- xwalk::NOTIFICATION_RUNTIME_OPENED,
- content::NotificationService::AllSources()));
- original_runtimes_.assign(runtimes().begin(), runtimes().end());
- }
-
- private:
- RuntimeList original_runtimes_;
- scoped_ptr<content::WindowedNotificationObserver> notification_observer_;
-};
-
-IN_PROC_BROWSER_TEST_F(XWalkRuntimeTest, LoadGeolocationPage) {
- GURL url = xwalk_test_utils::GetTestURL(
- base::FilePath(), base::FilePath().AppendASCII(
- "geolocation/simple.html"));
- size_t len = runtimes().size();
- xwalk_test_utils::NavigateToURL(runtime(), url);
- int error_code;
- ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
- runtime()->web_contents(),
- "console.log('wait for result...');",
- &error_code));
- EXPECT_NE(error_code, -1);
- content::RunAllPendingInMessageLoop();
- EXPECT_EQ(len, runtimes().size());
- runtime()->Close();
- content::RunAllPendingInMessageLoop();
- EXPECT_EQ(len - 1, runtimes().size());
-}
}
RuntimeContext::~RuntimeContext() {
- if (resource_context_) {
+ if (resource_context_.get()) {
BrowserThread::DeleteSoon(
BrowserThread::IO, FROM_HERE, resource_context_.release());
}
content::DownloadManagerDelegate* RuntimeContext::GetDownloadManagerDelegate() {
content::DownloadManager* manager = BrowserContext::GetDownloadManager(this);
- if (!download_manager_delegate_) {
+ if (!download_manager_delegate_.get()) {
download_manager_delegate_ = new RuntimeDownloadManagerDelegate();
download_manager_delegate_->SetDownloadManager(manager);
}
net::URLRequestContextGetter* RuntimeContext::CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) {
- DCHECK(!url_request_getter_);
+ DCHECK(!url_request_getter_.get());
application::ApplicationService* service =
XWalkRunner::GetInstance()->app_system()->application_service();
}
void RuntimeContext::AddVisitedURLs(const std::vector<GURL>& urls) {
- DCHECK(visitedlink_master_);
+ DCHECK(visitedlink_master_.get());
visitedlink_master_->AddURLs(urls);
}
#include "base/logging.h"
#include "content/public/browser/browser_thread.h"
-#include "xwalk/runtime/browser/xwalk_runner_tizen.h"
-#include "xwalk/application/browser/application_system.h"
-#include "xwalk/application/browser/application_service.h"
namespace xwalk {
namespace {
LOG(INFO) << "Locale change from " << locale_ << " to " << locale;
locale_ = locale;
-
- application::ApplicationSystem* application_system_ =
- XWalkRunnerTizen::GetInstance()->app_system();
- if (application_system_)
- application_system_->application_service()->ChangeLocale(locale);
}
} // namespace xwalk
#include "xwalk/application/browser/application_service.h"
#include "xwalk/application/browser/application_system.h"
#include "xwalk/extensions/browser/xwalk_extension_service.h"
+#include "xwalk/extensions/common/xwalk_extension_switches.h"
#include "xwalk/runtime/browser/application_component.h"
#include "xwalk/runtime/browser/runtime_context.h"
#include "xwalk/runtime/browser/storage_component.h"
void XWalkRunner::PreMainMessageLoopRun() {
runtime_context_.reset(new RuntimeContext);
app_extension_bridge_.reset(new XWalkAppExtensionBridge());
- extension_service_.reset(new extensions::XWalkExtensionService(
- app_extension_bridge_.get()));
+
+#if defined(OS_ANDROID)
+ CommandLine* cmd_line = CommandLine::ForCurrentProcess();
+ if (!cmd_line->HasSwitch(switches::kXWalkDisableExtensions))
+#endif
+ {
+ extension_service_.reset(new extensions::XWalkExtensionService(
+ app_extension_bridge_.get()));
+ }
+
CreateComponents();
app_extension_bridge_->SetApplicationSystem(app_component_->app_system());
}
#include "xwalk/runtime/renderer/xwalk_content_renderer_client.h"
+#include "base/command_line.h"
#include "base/strings/utf_string_conversions.h"
#include "components/nacl/renderer/ppb_nacl_private_impl.h"
#include "components/visitedlink/renderer/visitedlink_slave.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
#include "xwalk/application/common/constants.h"
#include "xwalk/application/renderer/application_native_module.h"
+#include "xwalk/extensions/common/xwalk_extension_switches.h"
#include "xwalk/extensions/renderer/xwalk_js_module.h"
#include "xwalk/runtime/common/xwalk_localized_error.h"
#include "xwalk/runtime/renderer/isolated_file_system.h"
// RenderFrameObserver implementation.
virtual void WillReleaseScriptContext(v8::Handle<v8::Context> context,
int world_id) OVERRIDE {
- extension_controller_->WillReleaseScriptContext(
- render_frame()->GetWebFrame(), context);
+ if (extension_controller_)
+ extension_controller_->WillReleaseScriptContext(
+ render_frame()->GetWebFrame(), context);
}
private:
}
void XWalkContentRendererClient::RenderThreadStarted() {
- extension_controller_.reset(
- new extensions::XWalkExtensionRendererController(this));
+#if defined(OS_ANDROID)
+ CommandLine* cmd_line = CommandLine::ForCurrentProcess();
+ if (!cmd_line->HasSwitch(switches::kXWalkDisableExtensions))
+#endif
+ {
+ extension_controller_.reset(
+ new extensions::XWalkExtensionRendererController(this));
+ }
blink::WebString application_scheme(
base::ASCIIToUTF16(application::kApplicationScheme));
void XWalkContentRendererClient::DidCreateScriptContext(
blink::WebFrame* frame, v8::Handle<v8::Context> context,
int extension_group, int world_id) {
- extension_controller_->DidCreateScriptContext(frame, context);
+ if (extension_controller_)
+ extension_controller_->DidCreateScriptContext(frame, context);
#if !defined(OS_ANDROID)
xwalk_render_process_observer_->DidCreateScriptContext(
frame, context, extension_group, world_id);
}
void TCPSocketObject::OnInit(scoped_ptr<XWalkExtensionFunctionInfo> info) {
- if (socket_) {
+ if (socket_.get()) {
DoRead();
return;
}
}
void TCPSocketObject::OnClose(scoped_ptr<XWalkExtensionFunctionInfo> info) {
- if (socket_)
+ if (socket_.get())
socket_->Disconnect();
setReadyState(READY_STATE_CLOSED);
}
void TCPSocketObject::OnHalfClose(scoped_ptr<XWalkExtensionFunctionInfo> info) {
- if (!socket_ || !socket_->IsConnected())
+ if (!socket_.get() || !socket_->IsConnected())
return;
is_half_closed_ = true;
if (is_half_closed_ || has_write_pending_)
return;
- if (!socket_ || !socket_->IsConnected())
+ if (!socket_.get() || !socket_->IsConnected())
return;
scoped_ptr<SendDOMString::Params>
--- /dev/null
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 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;
+
+import android.test.suitebuilder.annotation.SmallTest;
+
+import org.chromium.base.test.util.Feature;
+
+/**
+ * Test suite for onJavascriptCloseWindow().
+ */
+public class OnJavascriptCloseWindowTest extends XWalkViewTestBase {
+ TestHelperBridge.OnJavascriptCloseWindowHelper mCloseWindowHelper;
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+
+ mCloseWindowHelper = mTestHelperBridge.getOnJavascriptCloseWindowHelper();
+ }
+
+ @SmallTest
+ @Feature({"OnJavascriptCloseWindow"})
+ public void testOnJavascriptCloseWindow() throws Throwable {
+ final String url = "window.close.html";
+ int count = mCloseWindowHelper.getCallCount();
+
+ loadAssetFile(url);
+ mCloseWindowHelper.waitForCallback(count);
+ assertTrue(mCloseWindowHelper.getCalled());
+ }
+}
--- /dev/null
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 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;
+
+import android.test.suitebuilder.annotation.SmallTest;
+
+import org.chromium.base.test.util.Feature;
+import org.chromium.net.test.util.TestWebServer;
+
+/**
+ * Test suite for onProgressChanged().
+ */
+public class OnProgressChangedTest extends XWalkViewTestBase {
+ private TestHelperBridge.OnProgressChangedHelper mOnProgressChangedHelper;
+ private TestWebServer mWebServer;
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+
+ mOnProgressChangedHelper = mTestHelperBridge.getOnProgressChangedHelper();
+ mWebServer = new TestWebServer(false);
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ if (mWebServer != null) {
+ mWebServer.shutdown();
+ }
+ super.tearDown();
+ }
+
+ @SmallTest
+ @Feature({"OnProgressChanged"})
+ public void testOnProgressChanged() throws Throwable {
+ final int callCount = mOnProgressChangedHelper.getCallCount();
+ final String testHtml = "<html><head>Header</head><body>Body</body></html>";
+ final String testPath = "/test.html";
+ final String testUrl = mWebServer.setResponse(testPath, testHtml, null);
+
+ loadDataAsync(null, "<html><iframe src=\"" + testUrl + "\" /></html>",
+ "text/html",
+ false);
+
+ mOnProgressChangedHelper.waitForCallback(callCount);
+ assertTrue(mOnProgressChangedHelper.getProgress() > 0);
+ }
+}
}
}
+ public class OnProgressChangedHelper extends CallbackHelper {
+ private int mProgress;
+
+ public int getProgress() {
+ assert getCallCount() > 0;
+ return mProgress;
+ }
+
+ public void notifyCalled(int progress) {
+ mProgress = progress;
+ notifyCalled();
+ }
+ }
+
class OnEvaluateJavaScriptResultHelper extends CallbackHelper {
private String mJsonResult;
public void evaluateJavascript(XWalkView xWalkView, String code) {
}
}
+ public class OnJavascriptCloseWindowHelper extends CallbackHelper {
+ private boolean mCalled = false;
+
+ public boolean getCalled() {
+ assert getCallCount() > 0;
+ return mCalled;
+ }
+
+ public void notifyCalled(boolean called) {
+ mCalled = called;
+ notifyCalled();
+ }
+ }
+
private String mChangedTitle;
private final OnPageStartedHelper mOnPageStartedHelper;
private final OnPageFinishedHelper mOnPageFinishedHelper;
private final OnTitleUpdatedHelper mOnTitleUpdatedHelper;
private final ShouldInterceptLoadRequestHelper mShouldInterceptLoadRequestHelper;
private final OnLoadStartedHelper mOnLoadStartedHelper;
+ private final OnJavascriptCloseWindowHelper mOnJavascriptCloseWindowHelper;
+ private final OnProgressChangedHelper mOnProgressChangedHelper;
public TestHelperBridge() {
mOnPageStartedHelper = new OnPageStartedHelper();
mOnTitleUpdatedHelper = new OnTitleUpdatedHelper();
mShouldInterceptLoadRequestHelper = new ShouldInterceptLoadRequestHelper();
mOnLoadStartedHelper = new OnLoadStartedHelper();
+ mOnJavascriptCloseWindowHelper = new OnJavascriptCloseWindowHelper();
+ mOnProgressChangedHelper = new OnProgressChangedHelper();
}
public OnPageStartedHelper getOnPageStartedHelper() {
return mOnLoadStartedHelper;
}
+ public OnJavascriptCloseWindowHelper getOnJavascriptCloseWindowHelper() {
+ return mOnJavascriptCloseWindowHelper;
+ }
+
+ public OnProgressChangedHelper getOnProgressChangedHelper() {
+ return mOnProgressChangedHelper;
+ }
+
public void onTitleChanged(String title) {
mChangedTitle = title;
mOnTitleUpdatedHelper.notifyCalled(title);
public void onLoadStarted(String url) {
mOnLoadStartedHelper.notifyCalled(url);
}
+
+ public void onJavascriptCloseWindow() {
+ mOnJavascriptCloseWindowHelper.notifyCalled(true);
+ }
+
+ public void onProgressChanged(int progress) {
+ mOnProgressChangedHelper.notifyCalled(progress);
+ }
}
public void onReceivedTitle(XWalkView view, String title) {
mInnerContentsClient.onTitleChanged(title);
}
+
+ @Override
+ public void onJavascriptCloseWindow(XWalkView view) {
+ mInnerContentsClient.onJavascriptCloseWindow();
+ }
}
class TestXWalkUIClient extends TestXWalkUIClientBase {
String url) {
return mInnerContentsClient.shouldInterceptLoadRequest(url);
}
+
+ @Override
+ public void onProgressChanged(XWalkView view, int progressInPercent) {
+ mTestHelperBridge.onProgressChanged(progressInPercent);
+ }
}
class TestXWalkResourceClient extends TestXWalkResourceClientBase {
<application>
<uses-library android:name="android.test.runner" />
- <provider android:name="TestContentProvider"
- android:authorities="org.xwalk.core.internal.xwview.test.TestContentProvider" />
</application>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
// 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.XWalkViewInternal;
import org.xwalk.core.internal.XWalkClient;
import org.xwalk.core.internal.XWalkGeolocationPermissions;
import org.xwalk.core.internal.XWalkWebChromeClient;
/**
- * TODO(wang16): This test should be moved to internal test.
- *
* Test suite for onGeolocationPermissionsShowPrompt() and
* onGeolocationPermissionsHidePrompt().
*/
-public class GeolocationPermissionTest extends XWalkViewTestBase {
+public class GeolocationPermissionTest extends XWalkViewInternalTestBase {
@Override
public void setUp() throws Exception {
super.setUp();
// 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.MediumTest;
import org.chromium.content.browser.ContentView;
import org.chromium.content.browser.ContentViewCore;
-import org.xwalk.core.XWalkView;
import org.xwalk.core.internal.XWalkClient;
import org.xwalk.core.internal.XWalkViewInternal;
/**
- * TODO(wang16): This test should be moved to internal test.
- *
* Renderer responsiveness tests:
*
* Internally, a hang monitor timer will start for each renderer when there is
* is not received in 30 seconds, the renderer is deemed to be unresponsive to
* user interaction.
*/
-public class RendererResponsivenessTest extends XWalkViewTestBase {
+public class RendererResponsivenessTest extends XWalkViewInternalTestBase {
private OnRendererResponsivenessHelper responsiveHelper = new OnRendererResponsivenessHelper();
private OnRendererResponsivenessHelper unresponsiveHelper = new OnRendererResponsivenessHelper();
// 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.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.net.test.util.TestWebServer;
-import org.xwalk.core.XWalkView;
+import org.xwalk.core.internal.XWalkViewInternal;
import org.xwalk.core.internal.XWalkClient;
import org.xwalk.core.internal.XWalkSettings;
import org.xwalk.core.internal.XWalkWebChromeClient;
-import org.xwalk.core.xwview.test.util.CommonResources;
+import org.xwalk.core.internal.xwview.test.util.CommonResources;
/**
- * TODO(wang16): This test should be moved to internal test.
- *
* Test suite for setAppCacheEnabled().
*/
-public class SetAppCacheEnabledTest extends XWalkViewTestBase {
+public class SetAppCacheEnabledTest extends XWalkViewInternalTestBase {
private static final long TEST_TIMEOUT = 20000L;
private static final int CHECK_INTERVAL = 100;
private TestHelperBridge mContentClient;
}
}
- private XWalkSettings getXWalkSettings(final XWalkView view) {
+ private XWalkSettings getXWalkSettings(final XWalkViewInternal view) {
getInstrumentation().runOnMainSync(new Runnable() {
@Override
public void run() {
}
@SmallTest
- @Feature({"XWalkView", "Preferences", "AppCache"})
+ @Feature({"XWalkViewInternal", "Preferences", "AppCache"})
public void testAppCache() throws Throwable {
final TestHelperBridge helperBridge =
new TestHelperBridge();
mContentClient = helperBridge;
- final XWalkViewTestBase.TestXWalkUIClientBase uiClient =
- new XWalkViewTestBase.TestXWalkUIClientBase(helperBridge);
- final XWalkViewTestBase.TestXWalkResourceClientBase resourceClient =
- new XWalkViewTestBase.TestXWalkResourceClientBase(helperBridge);
- final XWalkView xWalkView =
+ final XWalkViewInternalTestBase.TestXWalkUIClientInternalBase uiClient =
+ new XWalkViewInternalTestBase.TestXWalkUIClientInternalBase(helperBridge);
+ final XWalkViewInternalTestBase.TestXWalkResourceClientBase resourceClient =
+ new XWalkViewInternalTestBase.TestXWalkResourceClientBase(helperBridge);
+ final XWalkViewInternal xWalkViewInternal =
createXWalkViewContainerOnMainSync(getActivity(), uiClient,
resourceClient);
- final XWalkSettings settings = getXWalkSettings(xWalkView);
+ final XWalkSettings settings = getXWalkSettings(xWalkViewInternal);
settings.setJavaScriptEnabled(true);
settings.setAppCacheEnabled(false);
ManifestTestHelper helper = new ManifestTestHelper(
webServer, "testAppCache.html", "appcache.manifest");
loadUrlSyncByContent(
- xWalkView,
+ xWalkViewInternal,
mContentClient,
helper.getHtmlUrl());
helper.waitUntilHtmlIsRequested(0);
// Enables AppCache. Use the default path if app cache path isn't set.
settings.setAppCacheEnabled(true);
loadUrlSyncByContent(
- xWalkView,
+ xWalkViewInternal,
mContentClient,
helper.getHtmlUrl());
helper.waitUntilManifestIsRequested(0);
/*
* @SmallTest
- * @Feature({"XWalkView", "Preferences", "AppCache"})
+ * @Feature({"XWalkViewInternal", "Preferences", "AppCache"})
* This test is flaky but the root cause is not found yet. See crbug.com/171765.
*/
@DisabledTest
ViewPair views = createViews();
XWalkSettings settings0 = getXWalkSettingsOnUiThreadByContent(
- views.getContent0());
+ views.getView0());
settings0.setJavaScriptEnabled(true);
settings0.setAppCachePath("whatever");
settings0.setAppCacheEnabled(true);
XWalkSettings settings1 = getXWalkSettingsOnUiThreadByContent(
- views.getContent1());
+ views.getView1());
settings1.setJavaScriptEnabled(true);
// AppCachePath setting is global, no need to set it for the second view.
settings1.setAppCacheEnabled(true);
webServer, "testAppCache_0.html", "appcache.manifest_0");
mContentClient = views.getClient0();
loadUrlSyncByContent(
- views.getContent0(),
+ views.getView0(),
mContentClient,
helper0.getHtmlUrl());
int manifestRequests0 = helper0.waitUntilManifestIsRequested(0);
webServer, "testAppCache_1.html", "appcache.manifest_1");
mContentClient = views.getClient1();
loadUrlSyncByContent(
- views.getContent1(),
+ views.getView1(),
mContentClient,
helper1.getHtmlUrl());
helper1.waitUntilManifestIsRequested(0);
settings1.setAppCacheEnabled(false);
mContentClient = views.getClient0();
loadUrlSyncByContent(
- views.getContent0(),
+ views.getView0(),
mContentClient,
helper0.getHtmlUrl());
helper0.waitUntilManifestIsRequested(manifestRequests0);
int htmlRequests1 = webServer.getRequestCount(helper1.getHtmlPath());
mContentClient = views.getClient1();
loadUrlSyncByContent(
- views.getContent1(),
+ views.getView1(),
mContentClient,
helper1.getHtmlUrl());
helper1.waitUntilHtmlIsRequested(htmlRequests1);
// 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 java.lang.Thread;
import java.lang.InterruptedException;
import android.util.Log;
import org.chromium.base.test.util.Feature;
-import org.xwalk.core.XWalkPreferences;
-import org.xwalk.core.XWalkView;
+import org.xwalk.core.internal.XWalkPreferencesInternal;
+import org.xwalk.core.internal.XWalkViewInternal;
import org.xwalk.core.internal.XWalkClient;
import org.xwalk.core.internal.XWalkWebChromeClient;
import org.xwalk.core.internal.XWalkNotificationServiceImpl;
/**
- * TODO(wang16): This test should be moved into internal test.
- *
* Test suite for web notification API.
* This test will only cover notification.show() and notification.close().
* The event handler will be covered in runtime level test. Because that
* will need activity to participate.
*/
-public class WebNotificationTest extends XWalkViewTestBase {
+public class WebNotificationTest extends XWalkViewInternalTestBase {
class TestXWalkNotificationService extends XWalkNotificationServiceImpl {
private Notification mNotification;
- public TestXWalkNotificationService(Context context, XWalkView view) {
+ public TestXWalkNotificationService(Context context, XWalkViewInternal view) {
super(context, view);
}
if (mNotification != null && mNotification.contentIntent != null) {
try {
mNotification.contentIntent.send();
- } catch (android.app.PendingIntent.CanceledException e) {}
+ } catch (android.app.PendingIntent.CanceledException e) {}
}
}
if (mNotification != null && mNotification.deleteIntent != null) {
try {
mNotification.deleteIntent.send();
- } catch (android.app.PendingIntent.CanceledException e) {}
+ } catch (android.app.PendingIntent.CanceledException e) {}
}
}
}
mNotificationService = new TestXWalkNotificationService(
getXWalkView().getActivity(), getXWalkView());
getXWalkView().setNotificationService(mNotificationService);
- XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
+ XWalkPreferencesInternal.setValue(XWalkPreferencesInternal.REMOTE_DEBUGGING, true);
}
});
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {}
- getInstrumentation().waitForIdleSync();
+ getInstrumentation().waitForIdleSync();
assertEquals("notification closed", getTitleOnUiThread());
}
}
--- /dev/null
+// Copyright (c) 2012 The Chromium Authors. 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.internal.xwview.test.util;
+
+import android.util.Pair;
+import java.util.ArrayList;
+import java.util.List;
+
+// Auxiliary class providing common HTML and base64 resources using for testing.
+public class CommonResources {
+
+ // Content-type headers used for HTML code.
+ public static List<Pair<String, String>> getTextHtmlHeaders(boolean disableCache) {
+ return getContentTypeAndCacheHeaders("text/html", disableCache);
+ }
+
+ // Content-type headers used for javascript code.
+ public static List<Pair<String, String>> getTextJavascriptHeaders(boolean disableCache) {
+ return getContentTypeAndCacheHeaders("text/javascript", disableCache);
+ }
+
+ // Content-type headers used for png images.
+ public static List<Pair<String, String>> getImagePngHeaders(boolean disableCache) {
+ return getContentTypeAndCacheHeaders("image/png", disableCache);
+ }
+
+ public static List<Pair<String, String>> getContentTypeAndCacheHeaders(
+ String contentType, boolean disableCache) {
+ List<Pair<String, String>> headers = new ArrayList<Pair<String, String>>();
+ headers.add(Pair.create("Content-Type", contentType));
+ if (disableCache) headers.add(Pair.create("Cache-Control", "no-store"));
+ return headers;
+ }
+
+ // Returns the HTML code used to verify if an image has been successfully loaded.
+ public static String getOnImageLoadedHtml(String imageSrc) {
+ return "<html>\n" +
+ " <head>\n" +
+ " <script>\n" +
+ " function updateTitle() {\n" +
+ " document.title=document.getElementById('img').naturalHeight\n" +
+ " }\n" +
+ " </script>\n" +
+ " </head>\n" +
+ " <body onload='updateTitle();'>\n" +
+ " <img id='img' onload='updateTitle();' src='" + imageSrc + "'>\n" +
+ " </body>\n" +
+ "</html>\n";
+ }
+
+ // Default name for the favicon image.
+ public static final String FAVICON_FILENAME = "favicon.png";
+
+ // HTML code of a static simple page with a favicon.
+ public static final String FAVICON_STATIC_HTML =
+ "<html><head><link rel=\"icon\" type=\"image/png\" href=\"" + FAVICON_FILENAME + "\">" +
+ "</head><body>Favicon example</body></html>";
+
+ // Base64 data of a favicon image resource.
+ public static final String FAVICON_DATA_BASE64 =
+ "iVBORw0KGgoAAAANSUhEUgAAABAAAAAFCAYAAABM6GxJAAAABHNCSVQICAgIfAhkiAAAASJJREFU" +
+ "GJU9yDtLQnEYwOHfOZ40L3gZDJKgJCKaamvpGzS09wUaormh7xA0S5C0ZDTkZJsNUltkkpAUZkIX" +
+ "L3g9FzzH/9vm9vAgoqRUGUu20JHTXFfafUdERJSIKJnOPFUTERHpqIYclY5nb2QKFumky95OlO+W" +
+ "TSgATqOO5k3xr6ZxelXmDFDhdaqfLkPRWQglULaN/V5DPzl3iIb9xCI+Eskog/wdyhowLlb4vThE" +
+ "giF8zRsurx55beg8lMfMezZW9hqz20M/Owhwe2/yUrPI5Ds8//mRehN7JYWxvIX6eWJkbLK9laL8" +
+ "ZrKxFETzxTBNB5SOJjKV/mhCq+uSjGvE4hHc4QA9YGAEwnhWF1ePkCtOWFv0+PiasL8bR3QDr93h" +
+ "HyFup9LWUksHAAAAAElFTkSuQmCC";
+
+ // Default name for an example 'about' HTML page.
+ public static final String ABOUT_FILENAME = "about.html";
+
+ // Title used in the 'about' example.
+ public static final String ABOUT_TITLE = "About the Google";
+
+ // HTML code of an 'about' example.
+ public static final String ABOUT_HTML =
+ "<html>" +
+ " <head>" +
+ " <title>" + ABOUT_TITLE + "</title>" +
+ " </head>" +
+ " <body>" +
+ " This is the Google!" +
+ " </body>" +
+ "</html>";
+
+ public static String makeHtmlPageFrom(String headers, String body) {
+ return "<html>" +
+ "<head>" +
+ "<style type=\"text/css\">" +
+ // Make the image take up all of the page so that we don't have to do
+ // any fancy hit target calculations when synthesizing the touch event
+ // to click it.
+ "img.big { width:100%; height:100%; background-color:blue; }" +
+ ".full_view { height:100%; width:100%; position:absolute; }" +
+ "</style>" +
+ headers +
+ "</head>" +
+ "<body>" +
+ body +
+ "</body>" +
+ "</html>";
+ }
+}
var testNewContactFlag = false;
var expectedNewPhoneNumber = '+4455001';
function testNewContacts() {
- // Test Case 2: check if oncontactchanges received all new contacts IDs.
- if (addedIDs.length != 2) {
- return;
- }
-
- if (ifcontains(addedIDs, contact1.id) && ifcontains(addedIDs, contact2.id)) {
- testNewContactFlag = true;
- }
-
// Test Case 3: update first contact after both contacts are saved.
var output = 'Will update contact ' +
contact1.id + ' ' +
contacts.save(contact1).then(updateCallback, errorCallback);
}
- var removedIDs = [];
- contacts.oncontactschange = function(data) {
- if (data.added) {
- addedIDs.push.apply(addedIDs, data.added); // Append added IDs to addedIDs
- testNewContacts();
- }
- if (data.removed) {
- removedIDs.push.apply(removedIDs, data.removed); // Append removed IDs to removedIDs
- tryFinalVerify();
- }
- }
-
// Create two contacts for testing
var givenName = 'John';
phoneNumbers: [mobilePhone2]
});
- contacts.save(contact1).then(function(item) { logContactSaved(item); contact1.id = item.id; }, errorCallback);
- contacts.save(contact2).then(function(item) { logContactSaved(item); contact2.id = item.id; }, errorCallback);
+ function handleSaveSuccessCallback(_contact, item) {
+ addedIDs.push(item.id);
+ logContactSaved(item);
+ _contact.id = item.id;
+ // Test Case 2: check if oncontactchanges received all new contacts IDs.
+ if (ifcontains(addedIDs, contact1.id) && ifcontains(addedIDs, contact2.id)) {
+ testNewContactFlag = true;
+ testNewContacts();
+ }
+ }
+
+ contacts.save(contact1).then(function(item) {
+ handleSaveSuccessCallback(contact1, item);
+ },
+ errorCallback);
+
+ contacts.save(contact2).then(function(item) {
+ handleSaveSuccessCallback(contact2, item);
+ },
+ errorCallback);
var testUpdateFirstFlag = false;
function updateCallback(item) {
function removeCallback() {
addHTML('remove', contact2.id + " is removed.<br>Will test clear()");
// Test Case 6: clear all contacts.
- contacts.clear().then(tryFinalVerify, errorCallback);
+ contacts.clear().then(clearCallback, errorCallback);
}
// Check if contacts are all removed, which means all test steps are done. If so we verify all results.
- function tryFinalVerify() {
- if (removedIDs.length != 2) {
- return;
- }
+ function clearCallback() {
addHTML('remove', "All contacts are removed.");
- testRemovedSecondFlag = ifcontains(removedIDs, contact2.id);
- if (testNewContactFlag && testUpdateFirstFlag && testFindFirstFlag && testRemovedSecondFlag) {
+ if (testNewContactFlag && testUpdateFirstFlag && testFindFirstFlag) {
document.title = 'Pass';
} else {
document.title = 'Fail';
--- /dev/null
+<html>
+<head>
+<title>window.close</title>
+</head>
+<body>
+<script>
+ var testWindow;
+ testWindow = window.open("", "_parent", "width=200, height=100");
+ testWindow.document.write("testWindow");
+ setTimeout(function(){ testWindow.close(); }, 100);
+</script>
+</body>
+</html>
// @SmallTest
// @Feature({"Contacts"})
- @DisabledTest
public void testContacts() throws Throwable {
RuntimeClientApiTestBase<XWalkRuntimeClientShellActivity> helper =
new RuntimeClientApiTestBase<XWalkRuntimeClientShellActivity>(
public class MessagingTest extends XWalkRuntimeClientTestBase {
// @SmallTest
// @Feature({"Messaging"})
- @DisabledTest
public void testMessaging() throws Throwable {
RuntimeClientApiTestBase<XWalkRuntimeClientShellActivity> helper =
new RuntimeClientApiTestBase<XWalkRuntimeClientShellActivity>(
// @SmallTest
// @Feature({"Contacts"})
- @DisabledTest
public void testContacts() throws Throwable {
RuntimeClientApiTestBase<XWalkRuntimeClientEmbeddedShellActivity> helper =
new RuntimeClientApiTestBase<XWalkRuntimeClientEmbeddedShellActivity>(
public class MessagingTest extends XWalkRuntimeClientTestBase {
// @SmallTest
// @Feature({"Messaging"})
- @DisabledTest
public void testMessaging() throws Throwable {
RuntimeClientApiTestBase<XWalkRuntimeClientEmbeddedShellActivity> helper =
new RuntimeClientApiTestBase<XWalkRuntimeClientEmbeddedShellActivity>(
+++ /dev/null
-<!DOCTYPE html>
-<html>
- <body>
- <p>Simple geolocation test</p>
- <div id="output"></div>
- <script>
- // error_code can be:
- // -1: not initilized
- // -2: success
- // other: error.code (see below)
- function sendResult(error_code) {
- console.log("error code: " + error_code);
- window.domAutomationController.send(error_code);
- }
-
- window.onload = function() {
- if (navigator.geolocation) {
- var options = {
- timeout: 5000
- };
- navigator.geolocation.getCurrentPosition(function(position) {
- document.getElementById("output").innerHTML =
- "Position latitude: " + position.coords.latitude +
- " longitude: " + position.coords.longitude;
- sendResult(-2);
- }, function(error) {
- document.getElementById("output").innerHTML =
- "Error occurred. Error code: " + error.code;
- sendResult(error.code);
- // error.code can be:
- // 0: unknown error
- // 1: permission denied
- // 2: position unavailable (error response from locaton provider)
- // 3: timed out
- },
- options);
- } else {
- console.log("navigator.geolocation is not available.");
- sendResult(-1);
- }
- };
- </script>
- </body>
-</html>
'<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/echo.html',
'<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/echoSync.html',
'<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/framesEcho.html',
- '<(PRODUCT_DIR)/xwalk_xwview_test/assets/geolocation.html',
'<(PRODUCT_DIR)/xwalk_xwview_test/assets/index.html',
'<(PRODUCT_DIR)/xwalk_xwview_test/assets/navigator.online.html',
- '<(PRODUCT_DIR)/xwalk_xwview_test/assets/notification.html',
- '<(PRODUCT_DIR)/xwalk_xwview_test/assets/renderHung.html',
+ '<(PRODUCT_DIR)/xwalk_xwview_test/assets/window.close.html',
],
'asset_location': '<(PRODUCT_DIR)/xwalk_xwview_test/assets',
},
'test/android/data/echo.html',
'test/android/data/echoSync.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',
+ 'test/android/data/window.close.html',
],
},
],
'<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/echo.html',
'<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/echoSync.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/notification.html',
+ '<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets/renderHung.html',
],
'asset_location': '<(PRODUCT_DIR)/xwalk_internal_xwview_test/assets',
},
'test/android/data/echo.html',
'test/android/data/echoSync.html',
'test/android/data/framesEcho.html',
+ 'test/android/data/geolocation.html',
'test/android/data/index.html',
+ 'test/android/data/notification.html',
+ 'test/android/data/renderHung.html',
],
},
],
'application/test/application_testapi_test.cc',
'experimental/native_file_system/native_file_system_api_browsertest.cc',
'runtime/browser/devtools/xwalk_devtools_browsertest.cc',
- 'runtime/browser/geolocation/xwalk_geolocation_browsertest.cc',
'runtime/browser/ui/taskbar_util_browsertest_win.cc',
'runtime/browser/xwalk_download_browsertest.cc',
'runtime/browser/xwalk_form_input_browsertest.cc',