OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // A test application for the RLZ library. | 5 // A test application for the RLZ library. |
6 // | 6 // |
7 // These tests should not be executed on the build server: | 7 // These tests should not be executed on the build server: |
8 // - They assert for the failed cases. | 8 // - They assert for the failed cases. |
9 // - They modify machine state (registry). | 9 // - They modify machine state (registry). |
10 // | 10 // |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 #endif | 438 #endif |
439 | 439 |
440 base::Thread::Options options; | 440 base::Thread::Options options; |
441 options.message_loop_type = base::MessageLoop::TYPE_IO; | 441 options.message_loop_type = base::MessageLoop::TYPE_IO; |
442 | 442 |
443 base::Thread io_thread("rlz_unittest_io_thread"); | 443 base::Thread io_thread("rlz_unittest_io_thread"); |
444 ASSERT_TRUE(io_thread.StartWithOptions(options)); | 444 ASSERT_TRUE(io_thread.StartWithOptions(options)); |
445 | 445 |
446 scoped_refptr<net::TestURLRequestContextGetter> context = | 446 scoped_refptr<net::TestURLRequestContextGetter> context = |
447 new net::TestURLRequestContextGetter( | 447 new net::TestURLRequestContextGetter( |
448 io_thread.message_loop()->message_loop_proxy()); | 448 io_thread.message_loop()->task_runner()); |
449 rlz_lib::SetURLRequestContext(context.get()); | 449 rlz_lib::SetURLRequestContext(context.get()); |
450 | 450 |
451 URLRequestRAII set_context(context.get()); | 451 URLRequestRAII set_context(context.get()); |
452 #endif | 452 #endif |
453 | 453 |
454 MachineDealCodeHelper::Clear(); | 454 MachineDealCodeHelper::Clear(); |
455 #if defined(OS_WIN) | 455 #if defined(OS_WIN) |
456 EXPECT_TRUE(rlz_lib::MachineDealCode::Set("dcc_value")); | 456 EXPECT_TRUE(rlz_lib::MachineDealCode::Set("dcc_value")); |
457 #endif | 457 #endif |
458 | 458 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 #endif | 491 #endif |
492 | 492 |
493 base::Thread::Options options; | 493 base::Thread::Options options; |
494 options.message_loop_type = base::MessageLoop::TYPE_IO; | 494 options.message_loop_type = base::MessageLoop::TYPE_IO; |
495 | 495 |
496 base::Thread io_thread("rlz_unittest_io_thread"); | 496 base::Thread io_thread("rlz_unittest_io_thread"); |
497 ASSERT_TRUE(io_thread.StartWithOptions(options)); | 497 ASSERT_TRUE(io_thread.StartWithOptions(options)); |
498 | 498 |
499 scoped_refptr<net::TestURLRequestContextGetter> context = | 499 scoped_refptr<net::TestURLRequestContextGetter> context = |
500 new net::TestURLRequestContextGetter( | 500 new net::TestURLRequestContextGetter( |
501 io_thread.message_loop()->message_loop_proxy()); | 501 io_thread.message_loop()->task_runner()); |
502 rlz_lib::SetURLRequestContext(context.get()); | 502 rlz_lib::SetURLRequestContext(context.get()); |
503 | 503 |
504 URLRequestRAII set_context(context.get()); | 504 URLRequestRAII set_context(context.get()); |
505 | 505 |
506 rlz_lib::AccessPoint points[] = | 506 rlz_lib::AccessPoint points[] = |
507 {rlz_lib::IETB_SEARCH_BOX, rlz_lib::NO_ACCESS_POINT, | 507 {rlz_lib::IETB_SEARCH_BOX, rlz_lib::NO_ACCESS_POINT, |
508 rlz_lib::NO_ACCESS_POINT}; | 508 rlz_lib::NO_ACCESS_POINT}; |
509 rlz_lib::test::ResetSendFinancialPingInterrupted(); | 509 rlz_lib::test::ResetSendFinancialPingInterrupted(); |
510 EXPECT_FALSE(rlz_lib::test::WasSendFinancialPingInterrupted()); | 510 EXPECT_FALSE(rlz_lib::test::WasSendFinancialPingInterrupted()); |
511 | 511 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 int mkdir_result = mkdir(rlz_lib::testing::RlzStoreFilenameStr().c_str(), | 931 int mkdir_result = mkdir(rlz_lib::testing::RlzStoreFilenameStr().c_str(), |
932 0500); | 932 0500); |
933 ASSERT_EQ(0, mkdir_result); | 933 ASSERT_EQ(0, mkdir_result); |
934 | 934 |
935 rlz_lib::SupplementaryBranding branding("TEST"); | 935 rlz_lib::SupplementaryBranding branding("TEST"); |
936 EXPECT_FALSE(rlz_lib::RecordProductEvent(rlz_lib::TOOLBAR_NOTIFIER, | 936 EXPECT_FALSE(rlz_lib::RecordProductEvent(rlz_lib::TOOLBAR_NOTIFIER, |
937 rlz_lib::IE_DEFAULT_SEARCH, rlz_lib::INSTALL)); | 937 rlz_lib::IE_DEFAULT_SEARCH, rlz_lib::INSTALL)); |
938 } | 938 } |
939 | 939 |
940 #endif | 940 #endif |
OLD | NEW |