Upstream version 8.37.183.0 27/25227/1
authorEurogiciel-BOT <eurogiciel.tizen@gmail.com>
Thu, 31 Jul 2014 09:21:10 +0000 (09:21 +0000)
committerEurogiciel-BOT <eurogiciel.tizen@gmail.com>
Thu, 31 Jul 2014 09:21:10 +0000 (09:21 +0000)
Upstream commit-id c3a4ae204a3c24e19194b0ac1b787466c397e219

Change-Id: Ie2f8b1e7b501f8491ee94c8a8d55cc1065cec4ba
Signed-off-by: Eurogiciel-BOT <eurogiciel.tizen@gmail.com>
115 files changed:
packaging/crosswalk-angle-do-not-depend-git-index.patch [deleted file]
packaging/crosswalk.spec
src/.DEPS.git
src/AUTHORS
src/DEPS
src/build/util/LASTCHANGE
src/content/public/android/java/src/org/chromium/content/browser/ScreenOrientationProvider.java
src/ozone/media/media_ozone_platform_wayland.cc
src/ozone/media/video.gypi
src/ozone/patches/0006-Temporarily-remove-ozone-dependency-for-gl.patch [new file with mode: 0644]
src/ozone/wayland/input_device.cc
src/third_party/angle/generate_projects
src/third_party/angle/projects/build/All.vcxproj
src/third_party/angle/projects/build/all.sln
src/third_party/angle/projects/samples/samples.sln
src/third_party/angle/projects/src/angle.sln
src/third_party/angle/projects/src/commit_id.vcxproj
src/third_party/angle/projects/src/commit_id.vcxproj.filters [deleted file]
src/third_party/angle/projects/src/copy_compiler_dll.vcxproj
src/third_party/angle/projects/src/copy_scripts.vcxproj
src/third_party/angle/projects/src/libEGL.vcxproj
src/third_party/angle/projects/src/libGLESv2.vcxproj
src/third_party/angle/src/angle.gypi
src/third_party/angle/src/commit.h [new file with mode: 0644]
src/third_party/angle/src/commit_id.bat [deleted file]
src/third_party/angle/src/commit_id.py
src/third_party/angle/src/common/version.h
src/third_party/angle/src/libGLESv2/ProgramBinary.cpp
src/ui/gl/gl.gyp
src/xwalk/DEPS.xwalk
src/xwalk/VERSION
src/xwalk/app/tools/android/app_info.py
src/xwalk/app/tools/android/customize.py
src/xwalk/app/tools/android/make_apk.py
src/xwalk/app/tools/android/make_apk_test.py
src/xwalk/app/tools/android/manifest_json_parser.py
src/xwalk/app/tools/android/test_data/launchScreen/manifest.json
src/xwalk/app/tools/android/test_data/launchScreen/manifest_deprecated_launch_screen.json
src/xwalk/app/tools/android/test_data/manifest/deprecated/manifest_app_local_path.json
src/xwalk/app/tools/android/test_data/manifest/deprecated/manifest_deprecated_version.json [moved from src/xwalk/app/tools/android/test_data/manifest/manifest_no_version.json with 59% similarity]
src/xwalk/app/tools/android/test_data/manifest/deprecated/manifest_description.json [new file with mode: 0644]
src/xwalk/app/tools/android/test_data/manifest/deprecated/manifest_launch_path.json
src/xwalk/app/tools/android/test_data/manifest/deprecated/manifest_permissions.json
src/xwalk/app/tools/android/test_data/manifest/invalidchars/manifest_contain_space_name.json
src/xwalk/app/tools/android/test_data/manifest/invalidchars/manifest_parse_error.json
src/xwalk/app/tools/android/test_data/manifest/invalidchars/manifest_with_chinese_name.json
src/xwalk/app/tools/android/test_data/manifest/invalidchars/manifest_with_invalid_name.json
src/xwalk/app/tools/android/test_data/manifest/invalidchars/manifest_with_space_name.json
src/xwalk/app/tools/android/test_data/manifest/manifest.json
src/xwalk/app/tools/android/test_data/manifest/manifest_app_launch_local_path.json
src/xwalk/app/tools/android/test_data/manifest/manifest_deprecated_icon.json
src/xwalk/app/tools/android/test_data/manifest/manifest_icon.json
src/xwalk/app/tools/android/test_data/manifest/manifest_no_app_launch_path.json
src/xwalk/app/tools/android/test_data/manifest/manifest_no_name.json
src/xwalk/app/tools/android/test_data/manifest/manifest_not_supported_permission.json
src/xwalk/app/tools/android/test_data/manifest/manifest_permissions_field_error.json
src/xwalk/app/tools/android/test_data/manifest/manifest_permissions_format_error.json
src/xwalk/application/browser/application.cc
src/xwalk/application/browser/application_service.cc
src/xwalk/application/browser/application_service.h
src/xwalk/application/browser/linux/running_applications_manager.cc
src/xwalk/application/common/application_file_util.cc
src/xwalk/application/common/application_file_util.h
src/xwalk/application/common/application_storage.cc
src/xwalk/application/common/application_storage.h
src/xwalk/application/common/application_storage_impl_tizen.cc [new file with mode: 0644]
src/xwalk/application/common/application_storage_impl_tizen.h [new file with mode: 0644]
src/xwalk/application/common/id_util.cc
src/xwalk/application/common/id_util.h
src/xwalk/application/common/installer/signature_data.h [new file with mode: 0644]
src/xwalk/application/common/installer/signature_parser.cc [new file with mode: 0644]
src/xwalk/application/common/installer/signature_parser.h [new file with mode: 0644]
src/xwalk/application/common/signature_types.h [new file with mode: 0644]
src/xwalk/application/common/xwalk_application_common.gypi
src/xwalk/application/tools/linux/xwalk_launcher_main.cc
src/xwalk/application/tools/linux/xwalkctl_main.cc
src/xwalk/build/system.gyp
src/xwalk/dbus/dbus_manager.cc
src/xwalk/experimental/native_file_system/virtual_root_provider_tizen.cc
src/xwalk/extensions/browser/xwalk_extension_process_host.cc
src/xwalk/extensions/common/xwalk_extension_switches.cc
src/xwalk/extensions/common/xwalk_extension_switches.h
src/xwalk/packaging/crosswalk-angle-do-not-depend-git-index.patch [deleted file]
src/xwalk/packaging/crosswalk.spec
src/xwalk/runtime/android/core_internal/src/org/xwalk/core/internal/AndroidProtocolHandler.java
src/xwalk/runtime/android/core_internal/src/org/xwalk/core/internal/XWalkViewInternal.java
src/xwalk/runtime/android/core_internal/src/org/xwalk/core/internal/extension/api/contacts/contacts_api.js
src/xwalk/runtime/android/core_internal_shell/AndroidManifest.xml
src/xwalk/runtime/browser/android/net/android_stream_reader_url_request_job.cc
src/xwalk/runtime/browser/android/xwalk_contents_io_thread_client_impl.cc
src/xwalk/runtime/browser/geolocation/xwalk_geolocation_browsertest.cc [deleted file]
src/xwalk/runtime/browser/runtime_context.cc
src/xwalk/runtime/browser/tizen/tizen_locale_listener.cc
src/xwalk/runtime/browser/xwalk_runner.cc
src/xwalk/runtime/renderer/xwalk_content_renderer_client.cc
src/xwalk/sysapps/raw_socket/tcp_socket_object.cc
src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/OnJavascriptCloseWindowTest.java [new file with mode: 0644]
src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/OnProgressChangedTest.java [new file with mode: 0644]
src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/TestHelperBridge.java
src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/XWalkViewTestBase.java
src/xwalk/test/android/core_internal/javatests/AndroidManifest.xml
src/xwalk/test/android/core_internal/javatests/src/org/xwalk/core/internal/xwview/test/GeolocationPermissionTest.java [moved from src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/GeolocationPermissionTest.java with 94% similarity]
src/xwalk/test/android/core_internal/javatests/src/org/xwalk/core/internal/xwview/test/RendererResponsivenessTest.java [moved from src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/RendererResponsivenessTest.java with 94% similarity]
src/xwalk/test/android/core_internal/javatests/src/org/xwalk/core/internal/xwview/test/SetAppCacheEnabledTest.java [moved from src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/SetAppCacheEnabledTest.java with 86% similarity]
src/xwalk/test/android/core_internal/javatests/src/org/xwalk/core/internal/xwview/test/WebNotificationTest.java [moved from src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/WebNotificationTest.java with 88% similarity]
src/xwalk/test/android/core_internal/javatests/src/org/xwalk/core/internal/xwview/test/util/CommonResources.java [new file with mode: 0644]
src/xwalk/test/android/data/contacts.html
src/xwalk/test/android/data/window.close.html [new file with mode: 0644]
src/xwalk/test/android/runtime_client/javatests/src/org/xwalk/runtime/client/test/ContactsTest.java
src/xwalk/test/android/runtime_client/javatests/src/org/xwalk/runtime/client/test/MessagingTest.java
src/xwalk/test/android/runtime_client_embedded/javatests/src/org/xwalk/runtime/client/embedded/test/ContactsTest.java
src/xwalk/test/android/runtime_client_embedded/javatests/src/org/xwalk/runtime/client/embedded/test/MessagingTest.java
src/xwalk/test/data/geolocation/simple.html [deleted file]
src/xwalk/xwalk_android_tests.gypi
src/xwalk/xwalk_tests.gypi

diff --git a/packaging/crosswalk-angle-do-not-depend-git-index.patch b/packaging/crosswalk-angle-do-not-depend-git-index.patch
deleted file mode 100644 (file)
index bbfe641..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-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' ],
-                         },
index edfa6e2..50e5e17 100644 (file)
@@ -16,7 +16,7 @@
 %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+)
@@ -31,7 +31,6 @@ Source1002:     %{name}.xml.in
 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
@@ -46,6 +45,7 @@ BuildRequires:  python
 BuildRequires:  python-xml
 BuildRequires:  perl
 BuildRequires:  which
+BuildRequires:  pkgconfig(ail)
 BuildRequires:  pkgconfig(alsa)
 BuildRequires:  pkgconfig(appcore-common)
 BuildRequires:  pkgconfig(cairo)
@@ -130,8 +130,6 @@ cp -a src/xwalk/LICENSE LICENSE.xwalk
 %patch10
 %endif
 
-%patch11
-
 %build
 
 # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
index 3e8ee38..9bcdb28 100644 (file)
@@ -11,7 +11,7 @@ vars = {
     'webkit_rev':
          '@f35b0cb58d8f1d16e8794f73805e9cfa1c9e6fa9',
     'angle_revision':
-         'ebba7d306b34a56f57ff1b87682bdc67cc9c50f8'
+         'c333af9c8e6b776363b722d9e9c4fed0b597f984'
 }
 
 deps = {
index 21f28d2..edca747 100644 (file)
@@ -355,6 +355,7 @@ Sevan Janiyan <venture37@geeklan.co.uk>
 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>
index d606d75..2762657 100644 (file)
--- a/src/DEPS
+++ b/src/DEPS
@@ -339,7 +339,7 @@ deps = {
   '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
index 97142b5..22594da 100644 (file)
@@ -1 +1 @@
-LASTCHANGE=283104
+LASTCHANGE=284396
index 47e79e6..0aebd44 100644 (file)
@@ -6,6 +6,7 @@ package org.chromium.content.browser;
 
 import android.app.Activity;
 import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
 import android.util.Log;
 
 import com.google.common.annotations.VisibleForTesting;
@@ -74,7 +75,17 @@ class ScreenOrientationProvider {
             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() {
index 5c06bfd..e746901 100644 (file)
@@ -6,7 +6,7 @@
 
 #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 {
 
@@ -21,10 +21,7 @@ class MediaOzonePlatformWayland : public MediaOzonePlatform {
   // 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:
index 935b628..8039249 100644 (file)
@@ -6,15 +6,15 @@
   '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',
   ],
diff --git a/src/ozone/patches/0006-Temporarily-remove-ozone-dependency-for-gl.patch b/src/ozone/patches/0006-Temporarily-remove-ozone-dependency-for-gl.patch
new file mode 100644 (file)
index 0000000..a7c0d71
--- /dev/null
@@ -0,0 +1,34 @@
+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
+
index 2217ce7..21f8bb6 100644 (file)
@@ -169,33 +169,30 @@ void WaylandInputDevice::OnSeatCapabilities(void *data,
   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) {
index 6743254..8175277 100644 (file)
@@ -34,6 +34,7 @@ if __name__ == '__main__':
     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...'
index f210466..5b8a2db 100644 (file)
@@ -36,7 +36,7 @@
   </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
index 00562af..b07ed85 100644 (file)
@@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 11.00
 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
@@ -30,9 +30,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "All", "All.vcxproj", "{D048
        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
@@ -68,7 +65,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libEGL", "..\src\libEGL.vcx
        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
index d912695..ade0cf0 100644 (file)
@@ -1,9 +1,6 @@
 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
@@ -39,7 +36,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libEGL", "..\src\libEGL.vcx
        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
index 08e3906..c476393 100644 (file)
@@ -1,9 +1,6 @@
 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
@@ -16,7 +13,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libEGL", "libEGL.vcxproj",
        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
index 3105692..7976a9f 100644 (file)
   </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(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };NOMINMAX;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
@@ -55,7 +53,7 @@
       <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(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };NOMINMAX;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };%(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(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };NOMINMAX;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
@@ -90,7 +85,7 @@
       <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(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };NOMINMAX;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };%(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 &quot;$(OutDir)obj\global_intermediate&quot;</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 &quot;$(OutDir)obj\global_intermediate\angle\id&quot; 2&gt;nul &amp; set ERRORLEVEL=0 &amp; copy /Y &quot;..\..\src\commit.h&quot; &quot;$(OutDir)obj\global_intermediate\angle\id\commit.h&quot;</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
diff --git a/src/third_party/angle/projects/src/commit_id.vcxproj.filters b/src/third_party/angle/projects/src/commit_id.vcxproj.filters
deleted file mode 100644 (file)
index 0385ff4..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?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
index b2accfb..68291a5 100644 (file)
   <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 &quot;$(Platform)&quot; &quot;C:\Program Files (x86)\Windows Kits\8.0&quot; &quot;$(OutDir)&quot;</Command>\r
+      <Command>call call $(OutDir)obj\global_intermediate\angle\copy_compiler_dll.bat &quot;$(Platform)&quot; &quot;C:\Program Files (x86)\Windows Kits\8.0&quot; &quot;$(OutDir)&quot;</Command>\r
       <Message>Copying D3D Compiler DLL...</Message>\r
       <Outputs>$(OutDir)\D3DCompiler_46.dll</Outputs>\r
     </CustomBuild>\r
index 56868a8..0061c5b 100644 (file)
   <ItemGroup>\r
     <CustomBuild Include="..\..\src\commit_id.py">\r
       <FileType>Document</FileType>\r
-      <Command>call mkdir &quot;$(OutDir)obj\global_intermediate&quot; 2&gt;nul &amp; set ERRORLEVEL=0 &amp; copy /Y &quot;..\..\src\commit_id.py&quot; &quot;$(OutDir)obj\global_intermediate\commit_id.py&quot;</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 &quot;$(OutDir)obj\global_intermediate&quot; 2&gt;nul &amp; set ERRORLEVEL=0 &amp; copy /Y &quot;..\..\src\commit_id.bat&quot; &quot;$(OutDir)obj\global_intermediate\commit_id.bat&quot;</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 &quot;$(OutDir)obj\global_intermediate\angle&quot; 2&gt;nul &amp; set ERRORLEVEL=0 &amp; copy /Y &quot;..\..\src\commit_id.py&quot; &quot;$(OutDir)obj\global_intermediate\angle\commit_id.py&quot;</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 &quot;$(OutDir)obj\global_intermediate&quot; 2&gt;nul &amp; set ERRORLEVEL=0 &amp; copy /Y &quot;..\..\src\copy_compiler_dll.bat&quot; &quot;$(OutDir)obj\global_intermediate\copy_compiler_dll.bat&quot;</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 &quot;$(OutDir)obj\global_intermediate\angle&quot; 2&gt;nul &amp; set ERRORLEVEL=0 &amp; copy /Y &quot;..\..\src\copy_compiler_dll.bat&quot; &quot;$(OutDir)obj\global_intermediate\angle\copy_compiler_dll.bat&quot;</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
index bc54fa1..a8485d7 100644 (file)
@@ -37,7 +37,7 @@
   </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(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };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(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };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
index c6f51e8..de88e07 100644 (file)
@@ -37,7 +37,7 @@
   </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(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };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(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };GL_APICALL=;GL_GLEXT_PROTOTYPES=;EGLAPI=;NOMINMAX;ANGLE_ENABLE_D3D9;ANGLE_ENABLE_D3D11;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
     </ResourceCompile>\r
index 5339369..ef16749 100644 (file)
@@ -7,6 +7,12 @@
     {
         '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)"
diff --git a/src/third_party/angle/src/commit.h b/src/third_party/angle/src/commit.h
new file mode 100644 (file)
index 0000000..4c89a65
--- /dev/null
@@ -0,0 +1,14 @@
+//
+// 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
diff --git a/src/third_party/angle/src/commit_id.bat b/src/third_party/angle/src/commit_id.bat
deleted file mode 100644 (file)
index 7b8cbe9..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-@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
index 6339cca..7f711e7 100644 (file)
@@ -1,19 +1,35 @@
 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)
index b9781d7..d9148d1 100644 (file)
@@ -1,4 +1,4 @@
-#include "commit.h"
+#include "id/commit.h"
 
 #define ANGLE_MAJOR_VERSION 2
 #define ANGLE_MINOR_VERSION 1
index 8525ffb..e3ffa47 100644 (file)
@@ -1018,6 +1018,9 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, FragmentShader *fragmentShade
 
 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>();
@@ -1260,6 +1263,7 @@ bool ProgramBinary::load(InfoLog &infoLog, const void *binary, GLsizei length)
     initializeUniformStorage();
 
     return true;
+#endif // #ifdef ANGLE_DISABLE_PROGRAM_BINARY_LOAD
 }
 
 bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length)
index 59e82a6..ba04c0c 100644 (file)
         ['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',
index 5dd99e4..1d6bccc 100644 (file)
 # 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'
index e30a208..ff51c11 100644 (file)
@@ -1,4 +1,4 @@
 MAJOR=8
 MINOR=37
-BUILD=180
+BUILD=183
 PATCH=0
index 1a5ac39..f3d476e 100644 (file)
@@ -11,8 +11,14 @@ class AppInfo:
     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 = ''
index 8667829..9c66960 100755 (executable)
@@ -24,19 +24,15 @@ from handle_permissions import HandlePermissions
 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 '
@@ -111,7 +107,7 @@ def CompressSourceFiles(app_root, compressor):
 
 
 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):
@@ -178,10 +174,19 @@ def CustomizeThemeXML(name, fullscreen, manifest):
 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'
@@ -202,10 +207,10 @@ def CustomizeXML(app_info, description, icon_dict, manifest, permissions):
     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)
@@ -243,7 +248,7 @@ def SetVariable(file_path, string_line, variable, value):
 
 
 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')
@@ -324,7 +329,7 @@ def CustomizeExtensions(app_info, extensions):
   """
   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'
@@ -410,7 +415,7 @@ def CustomizeExtensions(app_info, 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)
@@ -558,7 +563,7 @@ def main():
                  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:
index 78e04d6..b1a0163 100755 (executable)
@@ -16,8 +16,8 @@ import sys
 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
@@ -89,16 +89,10 @@ def GetVersion(path):
   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:
@@ -186,10 +180,11 @@ def MakeVersionCode(options):
 
 
 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)
@@ -480,7 +475,7 @@ def Execution(options, name):
   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':
@@ -494,8 +489,8 @@ def Execution(options, name):
     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
 
@@ -503,14 +498,14 @@ def PrintPackageInfo(options, packaged_archs):
     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())
 
@@ -533,7 +528,7 @@ def PrintPackageInfo(options, packaged_archs):
 
 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)
@@ -564,7 +559,7 @@ def MakeApk(options, app_info, manifest):
         print('No packages created, aborting')
         sys.exit(13)
 
-  PrintPackageInfo(options, packaged_archs)
+  PrintPackageInfo(options, name, packaged_archs)
 
 def main(argv):
   parser = optparse.OptionParser()
@@ -716,13 +711,6 @@ def main(argv):
   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:
@@ -753,14 +741,17 @@ def main(argv):
     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,
@@ -778,7 +769,7 @@ def main(argv):
   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
index f9e5e7b..cf349a5 100755 (executable)
@@ -1,4 +1,5 @@
 #!/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
@@ -12,8 +13,6 @@ import sys
 import unittest
 import warnings
 
-from customize import ReplaceSpaceWithUnderscore
-
 
 def Clean(name, app_version):
   if os.path.exists(name):
@@ -202,6 +201,7 @@ class TestMakeApk(unittest.TestCase):
 
   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')
@@ -212,16 +212,7 @@ class TestMakeApk(unittest.TestCase):
            '--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']
@@ -566,32 +557,49 @@ class TestMakeApk(unittest.TestCase):
            '--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',
@@ -607,12 +615,6 @@ class TestMakeApk(unittest.TestCase):
     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]
@@ -1018,77 +1020,29 @@ class TestMakeApk(unittest.TestCase):
 
     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():
@@ -1108,7 +1062,6 @@ 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'))
@@ -1129,7 +1082,7 @@ def SuiteWithModeOption():
 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'))
index f82230a..889b516 100755 (executable)
@@ -113,10 +113,16 @@ class ManifestJsonParser(object):
       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:
@@ -152,7 +158,14 @@ class ManifestJsonParser(object):
       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
index 6e38153..ea436a8 100644 (file)
@@ -2,7 +2,7 @@
   "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": {
index 6045bc0..a07b696 100644 (file)
@@ -2,7 +2,7 @@
   "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": {
index c5aefbb..cddcc28 100644 (file)
@@ -1,10 +1,10 @@
 {
   "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"
 }
@@ -1,8 +1,10 @@
 {
   "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"
 }
diff --git a/src/xwalk/app/tools/android/test_data/manifest/deprecated/manifest_description.json b/src/xwalk/app/tools/android/test_data/manifest/deprecated/manifest_description.json
new file mode 100644 (file)
index 0000000..3a760fa
--- /dev/null
@@ -0,0 +1,10 @@
+{
+  "name": "Example",
+  "version": "1.0.0",
+  "start_url": "http://www.intel.com",
+  "description": "a sample description",
+  "xwalk_permissions": [
+    "Contacts",
+    "Geolocation",
+    "Messaging"]
+}
index 6b0fce2..22a16d7 100644 (file)
@@ -1,6 +1,6 @@
 {
   "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"
 }
index 0253028..256071d 100644 (file)
@@ -1,8 +1,8 @@
 {
   "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",
index 666a4d8..a35d9e5 100644 (file)
@@ -1,7 +1,7 @@
 {
   "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"
 }
index f40344e..352effc 100644 (file)
@@ -1,7 +1,7 @@
 {
   "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"
 }
index a889c11..30921c1 100644 (file)
@@ -1,7 +1,7 @@
 {
   "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"
 }
index 732abe8..41ed5ce 100644 (file)
@@ -1,7 +1,7 @@
 {
   "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"
 }
index 04db34f..fb2fe26 100644 (file)
@@ -1,7 +1,7 @@
 {
   "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"
 }
index 56ac0e4..68e9edc 100644 (file)
@@ -1,8 +1,8 @@
 {
   "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",
index 0cee05e..30f85cf 100644 (file)
@@ -1,8 +1,8 @@
 {
   "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"]
index 1577d17..067d833 100644 (file)
@@ -1,8 +1,8 @@
 {
   "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",
index 7ff70b3..6c783c2 100644 (file)
@@ -1,8 +1,8 @@
 {
   "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",
index a8b58a3..6e7c845 100644 (file)
@@ -1,7 +1,7 @@
 {
   "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"
index f1a8de5..553e255 100644 (file)
@@ -1,7 +1,7 @@
 {
-  "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"
index 78e9ada..47b6b5b 100644 (file)
@@ -1,8 +1,8 @@
 {
   "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"
index e62f1d4..e1e3f2a 100644 (file)
@@ -1,8 +1,8 @@
 {
   "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"
index 93cc5c9..1ce8ed1 100644 (file)
@@ -1,8 +1,8 @@
 {
   "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"
index 101c26e..2e004ad 100644 (file)
@@ -60,7 +60,7 @@ Application::Application(
       entry_point_used_(Default),
       weak_factory_(this) {
   DCHECK(runtime_context_);
-  DCHECK(data_);
+  DCHECK(data_.get());
   DCHECK(observer_);
 }
 
index 74e09ac..e4c6005 100644 (file)
@@ -80,30 +80,6 @@ ApplicationService::ApplicationService(RuntimeContext* runtime_context,
 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) {
index 676db01..81da985 100644 (file)
@@ -32,11 +32,6 @@ class ApplicationService : public Application::Observer {
   // 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:
@@ -47,8 +42,6 @@ class ApplicationService : public Application::Observer {
                      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.
index 96b6246..acc121a 100644 (file)
@@ -131,9 +131,7 @@ void RunningApplicationsManager::OnLaunch(
     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.
index df07360..5bd7621 100644 (file)
@@ -322,6 +322,19 @@ scoped_refptr<ApplicationData> LoadApplication(
     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(
index fe75975..2d894f7 100644 (file)
@@ -38,6 +38,12 @@ scoped_refptr<ApplicationData> LoadApplication(
     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);
 
index 92a50af..271feaf 100644 (file)
@@ -3,7 +3,12 @@
 // 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 {
@@ -45,11 +50,6 @@ scoped_refptr<ApplicationData> ApplicationStorage::GetApplicationData(
   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);
index bb4c3dc..dde11b7 100644 (file)
@@ -30,10 +30,6 @@ class ApplicationStorage {
 
   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
diff --git a/src/xwalk/application/common/application_storage_impl_tizen.cc b/src/xwalk/application/common/application_storage_impl_tizen.cc
new file mode 100644 (file)
index 0000000..67490cb
--- /dev/null
@@ -0,0 +1,168 @@
+// 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
diff --git a/src/xwalk/application/common/application_storage_impl_tizen.h b/src/xwalk/application/common/application_storage_impl_tizen.h
new file mode 100644 (file)
index 0000000..79c43ff
--- /dev/null
@@ -0,0 +1,44 @@
+// 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_
index 1b4387c..02d9fe8 100644 (file)
@@ -76,6 +76,13 @@ std::string RawAppIdToAppIdForTizenPkgmgrDB(const std::string& id) {
   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();
index 6b99ed7..589cff0 100644 (file)
@@ -45,6 +45,8 @@ std::string RawAppIdToCrosswalkAppId(const std::string& 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,
diff --git a/src/xwalk/application/common/installer/signature_data.h b/src/xwalk/application/common/installer/signature_data.h
new file mode 100644 (file)
index 0000000..5f7f60a
--- /dev/null
@@ -0,0 +1,130 @@
+// 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_
diff --git a/src/xwalk/application/common/installer/signature_parser.cc b/src/xwalk/application/common/installer/signature_parser.cc
new file mode 100644 (file)
index 0000000..60c5b4d
--- /dev/null
@@ -0,0 +1,368 @@
+// 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
diff --git a/src/xwalk/application/common/installer/signature_parser.h b/src/xwalk/application/common/installer/signature_parser.h
new file mode 100644 (file)
index 0000000..e22cc44
--- /dev/null
@@ -0,0 +1,27 @@
+// 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_
diff --git a/src/xwalk/application/common/signature_types.h b/src/xwalk/application/common/signature_types.h
new file mode 100644 (file)
index 0000000..c26d4f9
--- /dev/null
@@ -0,0 +1,24 @@
+// 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_
index aec1d4f..cb7eca1 100644 (file)
@@ -17,8 +17,6 @@
       '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',
@@ -68,6 +70,8 @@
             '../../../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': [
index a171ed9..2d31fec 100644 (file)
@@ -18,7 +18,7 @@
 #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
@@ -298,11 +298,6 @@ int main(int argc, char** argv) {
     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) {
index 119934c..3791232 100644 (file)
@@ -74,20 +74,26 @@ static void TerminateIfRunning(const std::string& app_id) {
 #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");
index 61a654e..8ea6ac6 100644 (file)
@@ -34,6 +34,7 @@
           'type': 'none',
           'variables': {
             'packages': [
+              'ail',
               'dlog',
               'pkgmgr-parser',
               'pkgmgr-info',
index d283d84..cff3eef 100644 (file)
@@ -14,12 +14,12 @@ namespace xwalk {
 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";
index 5c723a2..4ef5093 100644 (file)
@@ -31,8 +31,4 @@ VirtualRootProvider::VirtualRootProvider() {
         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")));
 }
index 64bc023..8ac7e0d 100644 (file)
@@ -156,7 +156,7 @@ void XWalkExtensionProcessHost::StartProcess() {
 #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,
index fd71270..2b1bbcb 100644 (file)
@@ -23,4 +23,7 @@ const char kXWalkExternalExtensionsPath[] = "external-extensions-path";
 // 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
index 14070bd..c5ac171 100644 (file)
@@ -12,6 +12,7 @@ extern const char kXWalkDisableExtensionProcess[];
 extern const char kXWalkExtensionProcess[];
 extern const char kXWalkExternalExtensionsPath[];
 extern const char kXWalkExtensionCmdPrefix[];
+extern const char kXWalkDisableExtensions[];
 
 }  // namespace switches
 
diff --git a/src/xwalk/packaging/crosswalk-angle-do-not-depend-git-index.patch b/src/xwalk/packaging/crosswalk-angle-do-not-depend-git-index.patch
deleted file mode 100644 (file)
index bbfe641..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-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' ],
-                         },
index edfa6e2..50e5e17 100644 (file)
@@ -16,7 +16,7 @@
 %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+)
@@ -31,7 +31,6 @@ Source1002:     %{name}.xml.in
 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
@@ -46,6 +45,7 @@ BuildRequires:  python
 BuildRequires:  python-xml
 BuildRequires:  perl
 BuildRequires:  which
+BuildRequires:  pkgconfig(ail)
 BuildRequires:  pkgconfig(alsa)
 BuildRequires:  pkgconfig(appcore-common)
 BuildRequires:  pkgconfig(cairo)
@@ -130,8 +130,6 @@ cp -a src/xwalk/LICENSE LICENSE.xwalk
 %patch10
 %endif
 
-%patch11
-
 %build
 
 # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
index d4cf78a..681dc5b 100644 (file)
@@ -17,7 +17,7 @@ import java.net.URISyntaxException;
 import java.net.URLConnection;
 import java.util.List;
 
-import org.chromium.base.CalledByNativeUnchecked;
+import org.chromium.base.CalledByNative;
 import org.chromium.base.JNINamespace;
 
 /**
@@ -42,32 +42,34 @@ class AndroidProtocolHandler {
      * @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;
@@ -128,16 +130,16 @@ class AndroidProtocolHandler {
         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) {
@@ -162,10 +164,10 @@ class AndroidProtocolHandler {
             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;
@@ -183,9 +185,13 @@ class AndroidProtocolHandler {
     }
 
     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;
@@ -213,26 +219,28 @@ class AndroidProtocolHandler {
      * @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 {
@@ -247,11 +255,16 @@ class AndroidProtocolHandler {
      * @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;
+        }
     }
 
     /**
index 6b20e8f..4bea843 100644 (file)
@@ -29,6 +29,7 @@ import java.lang.ref.WeakReference;
 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;
@@ -330,10 +331,12 @@ public class XWalkViewInternal extends android.widget.FrameLayout {
         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(
@@ -558,7 +561,7 @@ public class XWalkViewInternal extends android.widget.FrameLayout {
      */
     public void onHide() {
         if (mContent == null || mIsHidden) return;
-        mExtensionManager.onPause();
+        if (null != mExtensionManager) mExtensionManager.onPause();
         mContent.onPause();
         mIsHidden = true;
     }
@@ -573,7 +576,7 @@ public class XWalkViewInternal extends android.widget.FrameLayout {
      */
     public void onShow() {
         if (mContent == null || !mIsHidden ) return;
-        mExtensionManager.onResume();
+        if (null != mExtensionManager) mExtensionManager.onResume();
         mContent.onResume();
         mIsHidden = false;
     }
@@ -600,7 +603,8 @@ public class XWalkViewInternal extends android.widget.FrameLayout {
      */
     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);
     }
 
@@ -765,7 +769,7 @@ public class XWalkViewInternal extends android.widget.FrameLayout {
         if (mContent == null) return;
         ApplicationStatus.unregisterActivityStateListener(mActivityStateListener);
         mActivityStateListener = null;
-        mExtensionManager.onDestroy();
+        if (null != mExtensionManager) mExtensionManager.onDestroy();
         mContent.destroy();
         disableRemoteDebugging();
     }
index 62b0599..01a1db3 100644 (file)
@@ -60,10 +60,15 @@ extension.setMessageListener(function(json) {
     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];
index db6690a..4176a60 100644 (file)
@@ -27,6 +27,8 @@
             <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" />
index 295c961..43e0c3b 100644 (file)
@@ -222,7 +222,7 @@ void AndroidStreamReaderURLRequestJob::OnInputStreamOpened(
       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());
 
@@ -277,7 +277,7 @@ bool AndroidStreamReaderURLRequestJob::ReadRawData(net::IOBuffer* dest,
                                                    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.
@@ -306,7 +306,7 @@ bool AndroidStreamReaderURLRequestJob::GetMimeType(
   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
@@ -322,7 +322,7 @@ bool AndroidStreamReaderURLRequestJob::GetCharset(std::string* charset) {
   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
index 634e86c..ef9e306 100644 (file)
@@ -112,7 +112,7 @@ class ClientMapEntryUpdater : public content::WebContentsObserver {
 
   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_;
@@ -143,7 +143,7 @@ void ClientMapEntryUpdater::RenderFrameDeleted(RenderFrameHost* rfh) {
   RfhToIoThreadClientMap::GetInstance()->Erase(GetRenderFrameHostIdPair(rfh));
 }
 
-void ClientMapEntryUpdater::WebContentsDestroyed(WebContents* web_contents) {
+void ClientMapEntryUpdater::WebContentsDestroyed() {
   delete this;
 }
 
diff --git a/src/xwalk/runtime/browser/geolocation/xwalk_geolocation_browsertest.cc b/src/xwalk/runtime/browser/geolocation/xwalk_geolocation_browsertest.cc
deleted file mode 100644 (file)
index 046629f..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-// 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());
-}
index ee41100..db4310d 100644 (file)
@@ -77,7 +77,7 @@ RuntimeContext::RuntimeContext()
 }
 
 RuntimeContext::~RuntimeContext() {
-  if (resource_context_) {
+  if (resource_context_.get()) {
     BrowserThread::DeleteSoon(
         BrowserThread::IO, FROM_HERE, resource_context_.release());
   }
@@ -118,7 +118,7 @@ bool RuntimeContext::IsOffTheRecord() const {
 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);
   }
@@ -192,7 +192,7 @@ content::PushMessagingService* RuntimeContext::GetPushMessagingService() {
 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();
@@ -272,7 +272,7 @@ void RuntimeContext::InitVisitedLinkMaster() {
 }
 
 void RuntimeContext::AddVisitedURLs(const std::vector<GURL>& urls) {
-  DCHECK(visitedlink_master_);
+  DCHECK(visitedlink_master_.get());
   visitedlink_master_->AddURLs(urls);
 }
 
index 94b1465..e4fc0df 100644 (file)
@@ -9,9 +9,6 @@
 
 #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 {
@@ -98,11 +95,6 @@ void TizenLocaleListener::SetLocale(const std::string& locale) {
 
   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
index cfb6589..32c7fbf 100644 (file)
@@ -12,6 +12,7 @@
 #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"
@@ -68,8 +69,16 @@ application::ApplicationSystem* XWalkRunner::app_system() {
 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());
 }
index 621eeb7..3f81edc 100644 (file)
@@ -4,6 +4,7 @@
 
 #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"
@@ -19,6 +20,7 @@
 #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"
@@ -66,8 +68,9 @@ class XWalkFrameHelper
   // 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:
@@ -92,8 +95,14 @@ XWalkContentRendererClient::~XWalkContentRendererClient() {
 }
 
 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));
@@ -137,7 +146,8 @@ void XWalkContentRendererClient::RenderViewCreated(
 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);
index 72b9427..6b3b515 100644 (file)
@@ -74,7 +74,7 @@ void TCPSocketObject::DoRead() {
 }
 
 void TCPSocketObject::OnInit(scoped_ptr<XWalkExtensionFunctionInfo> info) {
-  if (socket_) {
+  if (socket_.get()) {
     DoRead();
     return;
   }
@@ -101,7 +101,7 @@ void TCPSocketObject::OnInit(scoped_ptr<XWalkExtensionFunctionInfo> info) {
 }
 
 void TCPSocketObject::OnClose(scoped_ptr<XWalkExtensionFunctionInfo> info) {
-  if (socket_)
+  if (socket_.get())
     socket_->Disconnect();
 
   setReadyState(READY_STATE_CLOSED);
@@ -109,7 +109,7 @@ void TCPSocketObject::OnClose(scoped_ptr<XWalkExtensionFunctionInfo> info) {
 }
 
 void TCPSocketObject::OnHalfClose(scoped_ptr<XWalkExtensionFunctionInfo> info) {
-  if (!socket_ || !socket_->IsConnected())
+  if (!socket_.get() || !socket_->IsConnected())
     return;
 
   is_half_closed_ = true;
@@ -129,7 +129,7 @@ void TCPSocketObject::OnSendString(
   if (is_half_closed_ || has_write_pending_)
     return;
 
-  if (!socket_ || !socket_->IsConnected())
+  if (!socket_.get() || !socket_->IsConnected())
     return;
 
   scoped_ptr<SendDOMString::Params>
diff --git a/src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/OnJavascriptCloseWindowTest.java b/src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/OnJavascriptCloseWindowTest.java
new file mode 100644 (file)
index 0000000..2df7dfb
--- /dev/null
@@ -0,0 +1,35 @@
+// 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());
+    }
+}
diff --git a/src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/OnProgressChangedTest.java b/src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/OnProgressChangedTest.java
new file mode 100644 (file)
index 0000000..185ed71
--- /dev/null
@@ -0,0 +1,51 @@
+// 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);
+    }
+}
index 4603a78..ec10821 100644 (file)
@@ -80,6 +80,20 @@ class TestHelperBridge {
         }
     }
 
+    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) {
@@ -126,6 +140,20 @@ class TestHelperBridge {
         }
     }
 
+    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;
@@ -136,6 +164,8 @@ class TestHelperBridge {
     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();
@@ -145,6 +175,8 @@ class TestHelperBridge {
         mOnTitleUpdatedHelper = new OnTitleUpdatedHelper();
         mShouldInterceptLoadRequestHelper = new ShouldInterceptLoadRequestHelper();
         mOnLoadStartedHelper = new OnLoadStartedHelper();
+        mOnJavascriptCloseWindowHelper = new OnJavascriptCloseWindowHelper();
+        mOnProgressChangedHelper = new OnProgressChangedHelper();
     }
 
     public OnPageStartedHelper getOnPageStartedHelper() {
@@ -175,6 +207,14 @@ class TestHelperBridge {
         return mOnLoadStartedHelper;
     }
 
+    public OnJavascriptCloseWindowHelper getOnJavascriptCloseWindowHelper() {
+        return mOnJavascriptCloseWindowHelper;
+    }
+
+    public OnProgressChangedHelper getOnProgressChangedHelper() {
+        return mOnProgressChangedHelper;
+    }
+
     public void onTitleChanged(String title) {
         mChangedTitle = title;
         mOnTitleUpdatedHelper.notifyCalled(title);
@@ -205,4 +245,12 @@ class TestHelperBridge {
     public void onLoadStarted(String url) {
         mOnLoadStartedHelper.notifyCalled(url);
     }
+
+    public void onJavascriptCloseWindow() {
+        mOnJavascriptCloseWindowHelper.notifyCalled(true);
+    }
+
+    public void onProgressChanged(int progress) {
+        mOnProgressChangedHelper.notifyCalled(progress);
+    }
 }
index 4d4ef46..8be4a33 100644 (file)
@@ -60,6 +60,11 @@ public class XWalkViewTestBase
         public void onReceivedTitle(XWalkView view, String title) {
             mInnerContentsClient.onTitleChanged(title);
         }
+
+        @Override
+        public void onJavascriptCloseWindow(XWalkView view) {
+            mInnerContentsClient.onJavascriptCloseWindow();
+        }
     }
 
     class TestXWalkUIClient extends TestXWalkUIClientBase {
@@ -90,6 +95,11 @@ public class XWalkViewTestBase
                 String url) {
             return mInnerContentsClient.shouldInterceptLoadRequest(url);
         }
+
+        @Override
+        public void onProgressChanged(XWalkView view, int progressInPercent) {
+            mTestHelperBridge.onProgressChanged(progressInPercent);
+        }
     }
 
     class TestXWalkResourceClient extends TestXWalkResourceClientBase {
index 3022a05..5869976 100644 (file)
@@ -10,8 +10,6 @@
 
     <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" />
@@ -3,7 +3,7 @@
 // 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;
@@ -11,18 +11,16 @@ import android.util.Log;
 
 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();
@@ -1,9 +1,9 @@
 // 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;
@@ -19,13 +19,10 @@ import org.chromium.base.test.util.Feature;
 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
@@ -33,7 +30,7 @@ import org.xwalk.core.internal.XWalkViewInternal;
  * 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();
 
@@ -1,9 +1,9 @@
 // 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;
@@ -20,18 +20,16 @@ import org.chromium.content.browser.test.util.CallbackHelper;
 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;
@@ -89,7 +87,7 @@ public class SetAppCacheEnabledTest extends XWalkViewTestBase {
         }
     }
 
-    private XWalkSettings getXWalkSettings(final XWalkView view) {
+    private XWalkSettings getXWalkSettings(final XWalkViewInternal view) {
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
@@ -100,20 +98,20 @@ public class SetAppCacheEnabledTest extends XWalkViewTestBase {
     }
 
     @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);
 
@@ -123,7 +121,7 @@ public class SetAppCacheEnabledTest extends XWalkViewTestBase {
             ManifestTestHelper helper = new ManifestTestHelper(
                     webServer, "testAppCache.html", "appcache.manifest");
             loadUrlSyncByContent(
-                    xWalkView,
+                    xWalkViewInternal,
                     mContentClient,
                     helper.getHtmlUrl());
             helper.waitUntilHtmlIsRequested(0);
@@ -134,7 +132,7 @@ public class SetAppCacheEnabledTest extends XWalkViewTestBase {
             // 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);
@@ -145,7 +143,7 @@ public class SetAppCacheEnabledTest extends XWalkViewTestBase {
 
     /*
      * @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
@@ -156,12 +154,12 @@ public class SetAppCacheEnabledTest extends XWalkViewTestBase {
         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);
@@ -173,7 +171,7 @@ public class SetAppCacheEnabledTest extends XWalkViewTestBase {
                     webServer, "testAppCache_0.html", "appcache.manifest_0");
             mContentClient = views.getClient0();
             loadUrlSyncByContent(
-                    views.getContent0(),
+                    views.getView0(),
                     mContentClient,
                     helper0.getHtmlUrl());
             int manifestRequests0 = helper0.waitUntilManifestIsRequested(0);
@@ -181,14 +179,14 @@ public class SetAppCacheEnabledTest extends XWalkViewTestBase {
                     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);
@@ -197,7 +195,7 @@ public class SetAppCacheEnabledTest extends XWalkViewTestBase {
             int htmlRequests1 = webServer.getRequestCount(helper1.getHtmlPath());
             mContentClient = views.getClient1();
             loadUrlSyncByContent(
-                    views.getContent1(),
+                    views.getView1(),
                     mContentClient,
                     helper1.getHtmlUrl());
             helper1.waitUntilHtmlIsRequested(htmlRequests1);
@@ -2,7 +2,7 @@
 // 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;
@@ -16,25 +16,23 @@ import android.test.suitebuilder.annotation.SmallTest;
 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);
         }
 
@@ -49,7 +47,7 @@ public class WebNotificationTest extends XWalkViewTestBase {
             if (mNotification != null && mNotification.contentIntent != null) {
                 try {
                     mNotification.contentIntent.send();
-               } catch (android.app.PendingIntent.CanceledException e) {}
+                } catch (android.app.PendingIntent.CanceledException e) {}
             }
         }
 
@@ -57,7 +55,7 @@ public class WebNotificationTest extends XWalkViewTestBase {
             if (mNotification != null && mNotification.deleteIntent != null) {
                 try {
                     mNotification.deleteIntent.send();
-               } catch (android.app.PendingIntent.CanceledException e) {}
+                } catch (android.app.PendingIntent.CanceledException e) {}
             }
         }
     }
@@ -74,7 +72,7 @@ public class WebNotificationTest extends XWalkViewTestBase {
                 mNotificationService = new TestXWalkNotificationService(
                         getXWalkView().getActivity(), getXWalkView());
                 getXWalkView().setNotificationService(mNotificationService);
-                XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
+                XWalkPreferencesInternal.setValue(XWalkPreferencesInternal.REMOTE_DEBUGGING, true);
             }
         });
     }
@@ -117,7 +115,7 @@ public class WebNotificationTest extends XWalkViewTestBase {
         try {
             Thread.sleep(1000);
         } catch (InterruptedException e) {}
-       getInstrumentation().waitForIdleSync();
+        getInstrumentation().waitForIdleSync();
         assertEquals("notification closed", getTitleOnUiThread());
     }
 }
diff --git a/src/xwalk/test/android/core_internal/javatests/src/org/xwalk/core/internal/xwview/test/util/CommonResources.java b/src/xwalk/test/android/core_internal/javatests/src/org/xwalk/core/internal/xwview/test/util/CommonResources.java
new file mode 100644 (file)
index 0000000..8beec61
--- /dev/null
@@ -0,0 +1,105 @@
+// 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>";
+    }
+}
index c40e9fb..9fdbd41 100644 (file)
@@ -59,15 +59,6 @@ window.onload = function() {
   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 + ' ' +
@@ -80,18 +71,6 @@ window.onload = function() {
     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';
 
@@ -128,8 +107,26 @@ window.onload = function() {
     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) {
@@ -179,17 +176,13 @@ window.onload = function() {
   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';
diff --git a/src/xwalk/test/android/data/window.close.html b/src/xwalk/test/android/data/window.close.html
new file mode 100644 (file)
index 0000000..b796503
--- /dev/null
@@ -0,0 +1,13 @@
+<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>
index 3215608..f44f3ea 100644 (file)
@@ -18,7 +18,6 @@ public class ContactsTest extends XWalkRuntimeClientTestBase {
 
     // @SmallTest
     // @Feature({"Contacts"})
-    @DisabledTest
     public void testContacts() throws Throwable {
         RuntimeClientApiTestBase<XWalkRuntimeClientShellActivity> helper =
                 new RuntimeClientApiTestBase<XWalkRuntimeClientShellActivity>(
index 85ca3cf..2da563e 100644 (file)
@@ -16,7 +16,6 @@ import org.xwalk.test.util.RuntimeClientApiTestBase;
 public class MessagingTest extends XWalkRuntimeClientTestBase {
     // @SmallTest
     // @Feature({"Messaging"})
-    @DisabledTest
     public void testMessaging() throws Throwable {
         RuntimeClientApiTestBase<XWalkRuntimeClientShellActivity> helper =
                 new RuntimeClientApiTestBase<XWalkRuntimeClientShellActivity>(
index c834d39..97630db 100644 (file)
@@ -18,7 +18,6 @@ public class ContactsTest extends XWalkRuntimeClientTestBase {
 
     // @SmallTest
     // @Feature({"Contacts"})
-    @DisabledTest
     public void testContacts() throws Throwable {
         RuntimeClientApiTestBase<XWalkRuntimeClientEmbeddedShellActivity> helper =
                 new RuntimeClientApiTestBase<XWalkRuntimeClientEmbeddedShellActivity>(
index 2b88325..3598dda 100644 (file)
@@ -16,7 +16,6 @@ import org.xwalk.test.util.RuntimeClientApiTestBase;
 public class MessagingTest extends XWalkRuntimeClientTestBase {
     // @SmallTest
     // @Feature({"Messaging"})
-    @DisabledTest
     public void testMessaging() throws Throwable {
         RuntimeClientApiTestBase<XWalkRuntimeClientEmbeddedShellActivity> helper =
                 new RuntimeClientApiTestBase<XWalkRuntimeClientEmbeddedShellActivity>(
diff --git a/src/xwalk/test/data/geolocation/simple.html b/src/xwalk/test/data/geolocation/simple.html
deleted file mode 100644 (file)
index ed8de86..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<!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>
index 75279de..b4a2e5a 100644 (file)
           '<(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',
           ],
         },
       ],
index 991f599..c6c955a 100644 (file)
@@ -97,7 +97,6 @@
         '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',