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

Unified Diff: chrome/browser/extensions/api/webrtc_logging_private/webrtc_event_log_apitest.cc

Issue 2131133002: Reenable the WebRTC EventLog API Tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/webrtc_logging_private/webrtc_event_log_apitest.cc
diff --git a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_event_log_apitest.cc b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_event_log_apitest.cc
index df04767c80b4ce795de6b068d0b481c385830aa9..117f56de35237c0ff57e889b249f71fec9ec768b 100644
--- a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_event_log_apitest.cc
+++ b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_event_log_apitest.cc
@@ -40,12 +40,11 @@ namespace {
// Get the expected EventLog file name. The name will be
// <temporary path>.<render process id>.event_log.<consumer id>, for example
terelius1 2016/07/08 10:58:37 Please update the comment.
Ivo-OOO until feb 6 2016/07/08 11:24:35 Done. I renamed the variable below as well.
// /tmp/.org.chromium.Chromium.vsygNQ/dnFW8ch/Default/WebRTC
-// Logs/WebRtcEventLog.1.29113.event_log.1
+// Logs/WebRtcEventLog.1.6.1
base::FilePath GetExpectedEventLogFileName(const base::FilePath& base_file,
int render_process_id) {
static const int kExpectedConsumerId = 1;
return base_file.AddExtension(IntToStringType(render_process_id))
- .AddExtension(FILE_PATH_LITERAL("event_log"))
.AddExtension(IntToStringType(kExpectedConsumerId));
}
@@ -107,9 +106,7 @@ class WebrtcEventLogApiTest : public WebRtcTestBase {
} // namespace
-// TODO(ivoc): Reenable when the event log functionality in Chrome is updated.
-IN_PROC_BROWSER_TEST_F(WebrtcEventLogApiTest,
- DISABLED_TestStartStopWebRtcEventLogging) {
+IN_PROC_BROWSER_TEST_F(WebrtcEventLogApiTest, TestStartStopWebRtcEventLogging) {
ASSERT_TRUE(embedded_test_server()->Start());
content::WebContents* left_tab =
@@ -178,12 +175,14 @@ IN_PROC_BROWSER_TEST_F(WebrtcEventLogApiTest,
EXPECT_EQ(file_name_start, file_name_stop);
// Check that the file exists and is non-empty.
- base::ProcessId render_process_id =
- base::GetProcId(left_tab->GetRenderProcessHost()->GetHandle());
- EXPECT_NE(render_process_id, base::kNullProcessId);
+ content::RenderProcessHost* render_process_host =
+ left_tab->GetRenderProcessHost();
+ ASSERT_NE(render_process_host, nullptr);
+ int render_process_id = render_process_host->GetID();
base::FilePath full_file_name =
GetExpectedEventLogFileName(file_name_stop, render_process_id);
int64_t file_size = 0;
+ int timeout_counter = 0;
while (!(base::PathExists(full_file_name) &&
base::GetFileSize(full_file_name, &file_size) && file_size > 0)) {
// This should normally not happen, but is here to prevent the test
@@ -191,6 +190,10 @@ IN_PROC_BROWSER_TEST_F(WebrtcEventLogApiTest,
// /webrtc/webrtc_jsep01_test.html changes.
VLOG(1) << "Waiting for logfile to become available...";
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100));
+ if (timeout_counter++ >= 50) {
+ VLOG(1) << "Giving up on waiting for logfile.";
+ break;
+ }
}
ASSERT_TRUE(base::PathExists(full_file_name));
EXPECT_TRUE(base::GetFileSize(full_file_name, &file_size));
@@ -200,9 +203,8 @@ IN_PROC_BROWSER_TEST_F(WebrtcEventLogApiTest,
base::DeleteFile(full_file_name, false);
}
-// TODO(ivoc): Reenable when the event log functionality in Chrome is updated.
IN_PROC_BROWSER_TEST_F(WebrtcEventLogApiTest,
- DISABLED_TestStartTimedWebRtcEventLogging) {
+ TestStartTimedWebRtcEventLogging) {
ASSERT_TRUE(embedded_test_server()->Start());
content::WebContents* left_tab =
@@ -252,12 +254,14 @@ IN_PROC_BROWSER_TEST_F(WebrtcEventLogApiTest,
// The log has stopped automatically. Check that the file exists and is
// non-empty.
- base::ProcessId render_process_id =
- base::GetProcId(left_tab->GetRenderProcessHost()->GetHandle());
- EXPECT_NE(render_process_id, base::kNullProcessId);
+ content::RenderProcessHost* render_process_host =
+ left_tab->GetRenderProcessHost();
+ ASSERT_NE(render_process_host, nullptr);
+ int render_process_id = render_process_host->GetID();
base::FilePath full_file_name =
GetExpectedEventLogFileName(file_name_start, render_process_id);
int64_t file_size = 0;
+ int timeout_counter = 0;
while (!(base::PathExists(full_file_name) &&
base::GetFileSize(full_file_name, &file_size) && file_size > 0)) {
// This should normally not happen, but is here to prevent the test
@@ -265,6 +269,10 @@ IN_PROC_BROWSER_TEST_F(WebrtcEventLogApiTest,
// /webrtc/webrtc_jsep01_test.html changes.
VLOG(1) << "Waiting for logfile to become available...";
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100));
+ if (timeout_counter++ >= 50) {
+ VLOG(1) << "Giving up on waiting for logfile.";
+ break;
+ }
}
ASSERT_TRUE(base::PathExists(full_file_name));
EXPECT_TRUE(base::GetFileSize(full_file_name, &file_size));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698