summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaulmeyer <paulmeyer@chromium.org>2014-11-10 15:10:53 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-10 23:11:12 +0000
commitfeeff71519070dddf09693c273bb4cd89c6168dc (patch)
tree5ca7c6bbec751a3e9bc7a1037add77e7e22cda63
parentf5b2cda7e05f7ffa4ac57b6a00d9cd52c1e0ac87 (diff)
downloadchromium_src-feeff71519070dddf09693c273bb4cd89c6168dc.zip
chromium_src-feeff71519070dddf09693c273bb4cd89c6168dc.tar.gz
chromium_src-feeff71519070dddf09693c273bb4cd89c6168dc.tar.bz2
Fixed the source of the flakiness of the WebViewTest.ShimArcAttribute test.
BUG=431604 Review URL: https://codereview.chromium.org/692333009 Cr-Commit-Position: refs/heads/master@{#303529}
-rw-r--r--chrome/browser/apps/web_view_browsertest.cc8
-rw-r--r--extensions/renderer/resources/guest_view/web_view_attributes.js11
2 files changed, 12 insertions, 7 deletions
diff --git a/chrome/browser/apps/web_view_browsertest.cc b/chrome/browser/apps/web_view_browsertest.cc
index 3bd8395..4f61be5 100644
--- a/chrome/browser/apps/web_view_browsertest.cc
+++ b/chrome/browser/apps/web_view_browsertest.cc
@@ -1254,13 +1254,7 @@ IN_PROC_BROWSER_TEST_F(WebViewTest, InterstitialTeardown) {
window->GetBaseWindow()->Close();
}
-#if defined(OS_LINUX)
-// http://crbug.com/431604
-#define MAYBE_ShimSrcAttribute DISABLED_ShimSrcAttribute
-#else
-#define MAYBE_ShimSrcAttribute ShimSrcAttribute
-#endif
-IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_ShimSrcAttribute) {
+IN_PROC_BROWSER_TEST_F(WebViewTest, ShimSrcAttribute) {
ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/src_attribute"))
<< message_;
}
diff --git a/extensions/renderer/resources/guest_view/web_view_attributes.js b/extensions/renderer/resources/guest_view/web_view_attributes.js
index 745af03..f3ae1f1 100644
--- a/extensions/renderer/resources/guest_view/web_view_attributes.js
+++ b/extensions/renderer/resources/guest_view/web_view_attributes.js
@@ -189,6 +189,17 @@ function SrcAttribute(webViewImpl) {
SrcAttribute.prototype.__proto__ = WebViewAttribute.prototype;
+SrcAttribute.prototype.setValueIgnoreMutation = function(value) {
+ // takeRecords() is needed to clear queued up src mutations. Without it, it is
+ // possible for this change to get picked up asyncronously by src's mutation
+ // observer |observer|, and then get handled even though we do not want to
+ // handle this mutation.
+ this.observer.takeRecords();
+ this.ignoreMutation = true;
+ this.webViewImpl.webviewNode.setAttribute(this.name, value || '');
+ this.ignoreMutation = false;
+}
+
SrcAttribute.prototype.handleMutation = function(oldValue, newValue) {
// Once we have navigated, we don't allow clearing the src attribute.
// Once <webview> enters a navigated state, it cannot return to a