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 |