Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[Embeddingapi] TC dev for Setting xwalk:background color
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuyongyong committed May 23, 2016
1 parent 0f3612f commit 973458e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,15 @@
<category android:name="XWalkView.Basic" />
</intent-filter>
</activity>
<activity
android:name=".basic.XWalkViewWithSetBackgroundColorInLayout"
android:label="@string/title_activity_xwalk_view_with_set_background_color_in_layout"
android:parentActivityName=".XWalkEmbeddedAPISample" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="XWalkView.Basic" />
</intent-filter>
</activity>
<activity
android:name=".extended.XWalkViewWithComputeScroll"
android:label="@string/title_activity_xwalk_view_with_compute_scroll"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!--
Copyright (c) 2016 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.
-->

<org.xwalk.core.XWalkView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/xwalkview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FF0000" >

</org.xwalk.core.XWalkView>

Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ found in the LICENSE file.
<string name="title_activity_xwalk_view_with_shouldinterceptloadrequest">XWalkViewWithShouldInterceptLoadRequest</string>
<string name="title_activity_xwalk_view_with_clear_clientcert_preferences">XWalkViewWithClearClientCertPreferences</string>
<string name="title_activity_xwalk_view_with_set_background_color">XWalkViewWithSetBackgroundColor</string>
<string name="title_activity_xwalk_view_with_set_background_color_in_layout">XWalkViewWithSetBackgroundColorInLayout</string>
<string name="title_activity_xwalk_view_with_compute_scroll">XWalkViewWithComputeScroll</string>
<string name="title_activity_xwalk_view_with_new_load">XWalkViewWithNewLoad</string>
<string name="title_activity_xwalk_view_get_certificate">XWalkViewGetCertificate</string>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 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.embedded.api.sample.basic;

import org.xwalk.embedded.api.sample.R;

import org.xwalk.core.XWalkActivity;
import org.xwalk.core.XWalkView;

import android.app.AlertDialog;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.LinearLayout;

public class XWalkViewWithSetBackgroundColorInLayout extends XWalkActivity {
private XWalkView mXWalkView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.container);
}

@Override
protected void onXWalkReady() {
StringBuffer mess = new StringBuffer();
mess.append("Test Purpose: \n\n")
.append("Verifies XWalkView can set background color without delay.\n\n")
.append("Expected Result:\n\n")
.append("Test passes if app load the red without flicker.");
new AlertDialog.Builder(this)
.setTitle("Info" )
.setMessage(mess.toString())
.setPositiveButton("confirm" , null )
.show();

setContentView(R.layout.xwview_backgroundcolor_layout);
mXWalkView = (XWalkView) findViewById(R.id.xwalkview);
mXWalkView.load("file:///android_asset/index4995_local_text.html", null);
}

}

0 comments on commit 973458e

Please sign in to comment.