| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/public/browser/tracing_controller.h" | 5 #include "content/public/browser/tracing_controller.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 last_metadata()->GetString("user-agent", &user_agent); | 375 last_metadata()->GetString("user-agent", &user_agent); |
| 376 EXPECT_TRUE(user_agent.length() > 0); | 376 EXPECT_TRUE(user_agent.length() > 0); |
| 377 std::string os_name; | 377 std::string os_name; |
| 378 last_metadata()->GetString("os-name", &os_name); | 378 last_metadata()->GetString("os-name", &os_name); |
| 379 EXPECT_TRUE(os_name.length() > 0); | 379 EXPECT_TRUE(os_name.length() > 0); |
| 380 std::string cpu_brand; | 380 std::string cpu_brand; |
| 381 last_metadata()->GetString("cpu-brand", &cpu_brand); | 381 last_metadata()->GetString("cpu-brand", &cpu_brand); |
| 382 EXPECT_TRUE(cpu_brand.length() > 0); | 382 EXPECT_TRUE(cpu_brand.length() > 0); |
| 383 } | 383 } |
| 384 | 384 |
| 385 IN_PROC_BROWSER_TEST_F(TracingControllerTest, NotWhitelistedMetadataStripped) { | 385 // TODO(crbug.com/642991) Disabled for flakiness. |
| 386 IN_PROC_BROWSER_TEST_F(TracingControllerTest, |
| 387 DISABLED_NotWhitelistedMetadataStripped) { |
| 386 TestStartAndStopTracingStringWithFilter(); | 388 TestStartAndStopTracingStringWithFilter(); |
| 387 // Check that a number of important keys exist in the metadata dictionary. | 389 // Check that a number of important keys exist in the metadata dictionary. |
| 388 EXPECT_TRUE(last_metadata() != NULL); | 390 EXPECT_TRUE(last_metadata() != NULL); |
| 389 std::string cpu_brand; | 391 std::string cpu_brand; |
| 390 last_metadata()->GetString("cpu-brand", &cpu_brand); | 392 last_metadata()->GetString("cpu-brand", &cpu_brand); |
| 391 EXPECT_TRUE(cpu_brand.length() > 0); | 393 EXPECT_TRUE(cpu_brand.length() > 0); |
| 392 EXPECT_TRUE(cpu_brand != "__stripped__"); | 394 EXPECT_TRUE(cpu_brand != "__stripped__"); |
| 393 std::string network_type; | 395 std::string network_type; |
| 394 last_metadata()->GetString("network-type", &network_type); | 396 last_metadata()->GetString("network-type", &network_type); |
| 395 EXPECT_TRUE(network_type.length() > 0); | 397 EXPECT_TRUE(network_type.length() > 0); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 | 444 |
| 443 TracingController* controller = TracingController::GetInstance(); | 445 TracingController* controller = TracingController::GetInstance(); |
| 444 EXPECT_TRUE(controller->StartTracing( | 446 EXPECT_TRUE(controller->StartTracing( |
| 445 TraceConfig(), | 447 TraceConfig(), |
| 446 TracingController::StartTracingDoneCallback())); | 448 TracingController::StartTracingDoneCallback())); |
| 447 EXPECT_TRUE(controller->StopTracing(NULL)); | 449 EXPECT_TRUE(controller->StopTracing(NULL)); |
| 448 base::RunLoop().RunUntilIdle(); | 450 base::RunLoop().RunUntilIdle(); |
| 449 } | 451 } |
| 450 | 452 |
| 451 } // namespace content | 453 } // namespace content |
| OLD | NEW |