Commit 9abefd14 authored by Yuri Wiitala's avatar Yuri Wiitala Committed by Commit Bot

performance_browser_tests: Stabilize around AV-sync, run with AudioService.

Ensures that the separate, sandboxed Audio Service process is being used
when the tests are run. Also, prevents tests from failing due to recent
breakage of AV-sync measurement methodology (fix is being researched).

Bug: 940087
Change-Id: I0d7189ba9ce0d03bc8401a636085b4cc0f779920
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1555713
Auto-Submit: Yuri Wiitala <miu@chromium.org>
Commit-Queue: Caleb Rouleau <crouleau@chromium.org>
Reviewed-by: default avatarCaleb Rouleau <crouleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#648503}
parent 153dc4e3
...@@ -67,13 +67,13 @@ constexpr int kMinDataPointsForQuickRun = 3; ...@@ -67,13 +67,13 @@ constexpr int kMinDataPointsForQuickRun = 3;
// long enough to collect sufficient tracing data; and, unfortunately, there's // long enough to collect sufficient tracing data; and, unfortunately, there's
// nothing we can do about that. // nothing we can do about that.
#define EXPECT_FOR_PERFORMANCE_RUN(expr) \ #define EXPECT_FOR_PERFORMANCE_RUN(expr) \
do { \ if (!(expr)) { \
if (is_full_performance_run()) { \ if (is_full_performance_run()) { \
EXPECT_TRUE(expr); \ LOG(ERROR) << "Failure: " << #expr; \
} else if (!(expr)) { \ } else { \
LOG(WARNING) << "Allowing failure: " << #expr; \ LOG(WARNING) << "Allowing failure: " << #expr; \
} \ } \
} while (false) }
enum TestFlags { enum TestFlags {
kSmallWindow = 1 << 2, // Window size: 1 = 800x600, 0 = 2000x1000 kSmallWindow = 1 << 2, // Window size: 1 = 800x600, 0 = 2000x1000
...@@ -168,7 +168,7 @@ class MeanAndError { ...@@ -168,7 +168,7 @@ class MeanAndError {
const std::string& modifier, const std::string& modifier,
const std::string& trace, const std::string& trace,
const std::string& unit) { const std::string& unit) {
if (num_values_ >= 20) { if (num_values_ > 0) {
perf_test::PrintResultMeanAndError(measurement, perf_test::PrintResultMeanAndError(measurement,
modifier, modifier,
trace, trace,
...@@ -176,8 +176,7 @@ class MeanAndError { ...@@ -176,8 +176,7 @@ class MeanAndError {
unit, unit,
true); true);
} else { } else {
LOG(ERROR) << "Not enough events (" << num_values_ << ") for " LOG(ERROR) << "No events for " << measurement << modifier << " " << trace;
<< measurement << modifier << " " << trace;
} }
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "chrome/test/base/tracing.h" #include "chrome/test/base/tracing.h"
#include "chrome/test/base/ui_test_utils.h" #include "chrome/test/base/ui_test_utils.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test_utils.h" #include "content/public/test/browser_test_utils.h"
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system.h"
...@@ -32,6 +33,7 @@ ...@@ -32,6 +33,7 @@
#include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h" #include "net/test/embedded_test_server/http_response.h"
#include "services/service_manager/sandbox/features.h"
#include "third_party/zlib/google/compression_utils.h" #include "third_party/zlib/google/compression_utils.h"
#include "ui/gl/gl_switches.h" #include "ui/gl/gl_switches.h"
...@@ -47,6 +49,15 @@ void TabCapturePerformanceTestBase::SetUp() { ...@@ -47,6 +49,15 @@ void TabCapturePerformanceTestBase::SetUp() {
// Because screen capture is involved, require pixel output. // Because screen capture is involved, require pixel output.
EnablePixelOutput(); EnablePixelOutput();
feature_list_.InitWithFeatures(
{
service_manager::features::kAudioServiceSandbox,
features::kAudioServiceAudioStreams,
features::kAudioServiceLaunchOnStartup,
features::kAudioServiceOutOfProcess,
},
{});
InProcessBrowserTest::SetUp(); InProcessBrowserTest::SetUp();
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/trace_event_analyzer.h" #include "base/test/trace_event_analyzer.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
...@@ -135,6 +136,9 @@ class TabCapturePerformanceTestBase : public InProcessBrowserTest { ...@@ -135,6 +136,9 @@ class TabCapturePerformanceTestBase : public InProcessBrowserTest {
const extensions::Extension* extension_ = nullptr; const extensions::Extension* extension_ = nullptr;
// Manages the Audio Service feature set, enabled for these performance tests.
base::test::ScopedFeatureList feature_list_;
DISALLOW_COPY_AND_ASSIGN(TabCapturePerformanceTestBase); DISALLOW_COPY_AND_ASSIGN(TabCapturePerformanceTestBase);
}; };
......
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