Commit 9f84eb64 authored by Michael Bai's avatar Michael Bai Committed by Commit Bot

AW: Add reload menu to SystemWebViewShell

This feature will make the related test easy.

Change-Id: I93835a5ccdf7b3adea6e360e980432e482ddb1d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2405704Reviewed-by: default avatarTim Volodine <timvolodine@chromium.org>
Commit-Queue: Michael Bai <michaelbai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807941}
parent 185b47d3
......@@ -4,6 +4,8 @@
found in the LICENSE file. -->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_reload_webview"
android:title="@string/menu_reload_webview"/>
<item android:id="@+id/menu_reset_webview"
android:title="@string/menu_reset_webview"/>
<item android:id="@+id/menu_clear_cache"
......
......@@ -15,6 +15,7 @@
<string name="title_activity_thread_test">WebView Thread Test</string>
<string name="title_activity_page_cycler">WebView Page Cycler Test</string>
<string name="title_activity_create_destroy">WebView Create Destroy</string>
<string name="menu_reload_webview">Reload</string>
<string name="menu_reset_webview">Destroy and create new WebView</string>
<string name="menu_clear_cache">Clear cache</string>
<string name="menu_enable_tracing">Enable tracing</string>
......
......@@ -605,7 +605,9 @@ public class WebViewBrowserActivity extends AppCompatActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId();
if (itemId == R.id.menu_reset_webview) {
if (itemId == R.id.menu_reload_webview) {
if (mWebView != null) mWebView.reload();
} else if (itemId == R.id.menu_reset_webview) {
if (mWebView != null) {
ViewGroup container = getContainer();
container.removeView(mWebView);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment