Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: chrome/browser/extensions/extension_functional_browsertest.cc

Issue 2925193002: NOT YET READY: UMA recording the kind of target frame when extensions pierce browsing instance.
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_management.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_functional_browsertest.cc
diff --git a/chrome/browser/extensions/extension_functional_browsertest.cc b/chrome/browser/extensions/extension_functional_browsertest.cc
index 9e6b5ba6cd418e91294e17282ff20128af44beba..f70bb33f97b82a8581f1927af1f14bd1a3180f61 100644
--- a/chrome/browser/extensions/extension_functional_browsertest.cc
+++ b/chrome/browser/extensions/extension_functional_browsertest.cc
@@ -4,6 +4,7 @@
#include <stddef.h>
+#include "base/test/histogram_tester.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/extension_browsertest.h"
@@ -23,6 +24,8 @@
#include "extensions/browser/extension_util.h"
#include "extensions/browser/notification_types.h"
#include "extensions/browser/test_extension_registry_observer.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
@@ -114,6 +117,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionFunctionalTest, MAYBE_TestSetExtensionsState) {
IN_PROC_BROWSER_TEST_F(ExtensionFunctionalTest,
FindingUnrelatedExtensionFramesFromAboutBlank) {
+ base::HistogramTester histogram_tester;
+
// Load an extension before adding tabs.
const extensions::Extension* extension =
LoadExtension(test_data_dir_.AppendASCII("simple_with_file"));
@@ -166,6 +171,16 @@ IN_PROC_BROWSER_TEST_F(ExtensionFunctionalTest,
"window.domAutomationController.send(w.location.href);",
&location_of_opened_window));
EXPECT_EQ(tab2->GetLastCommittedURL(), location_of_opened_window);
+
+ // Verify UMA got recorded as expected.
+ // DO NOT SUBMIT - need to flush/sync the histograms logged in the renderer
+ // for |tab1_popup|.
Łukasz Anforowicz 2017/06/07 23:24:35 How would a browser test force a sync in a canonic
+ EXPECT_THAT(histogram_tester.GetAllSamples(
+ "Extensions.BrowsingInstanceViolation.ExtensionType"),
+ testing::ElementsAre(base::Bucket(Manifest::TYPE_EXTENSION, 1)));
+ EXPECT_THAT(histogram_tester.GetAllSamples(
+ "Extensions.BrowsingInstanceViolation.ExtensionViewType"),
+ testing::ElementsAre(base::Bucket(VIEW_TYPE_TAB_CONTENTS, 1)));
}
} // namespace extensions
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_management.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698