Skip to content

Commit

Permalink
Fixing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
boocmp committed May 12, 2022
1 parent ab40d46 commit aafa710
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion browser/tor/brave_local_state_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ IN_PROC_BROWSER_TEST_F(BraveLocalStateBrowserTest, BasicTest) {
}

IN_PROC_BROWSER_TEST_F(BraveLocalStateBrowserTest, ChangeTest) {
TorProfileServiceFactory::SetTorDisabled(false);
TorProfileServiceFactory::SetTorDisabled(true);
EXPECT_TRUE(TorProfileServiceFactory::IsTorDisabled());

tor::BridgesConfig bridges_config;
Expand Down
9 changes: 8 additions & 1 deletion browser/tor/brave_tor_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ class BraveTorTest : public InProcessBrowserTest {
}
}

void WaitProcessExit(int pid) {
base::Process p = base::Process::Open(pid);
if (p.IsValid()) {
p.WaitForExit(nullptr);
}
}

void WaitProcessExit(const std::string& name) {
while (base::GetProcessCount(base::FilePath::FromASCII(name).value(),
nullptr)) {
Expand All @@ -194,7 +201,7 @@ IN_PROC_BROWSER_TEST_F(BraveTorTest, OpenCloseDisableTorWindow) {
tor_browser, ui_test_utils::BrowserChangeObserver::ChangeType::kRemoved)
.Wait();

EXPECT_FALSE(base::Process::Open(tor.tor_pid).IsValid());
WaitProcessExit(tor.tor_pid);
}

// Disable tor, expect executables are removed.
Expand Down
2 changes: 1 addition & 1 deletion components/tor/brave_tor_pluggable_transport_updater.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ constexpr const char kComponentName[] = "Brave Pluggable Transports (Linux)";
#endif

constexpr const char kSnowflakeExecutableName[] = "tor-snowflake-brave";
constexpr const char kObfs4ExecutableName[] = "tor-obsf4-brave";
constexpr const char kObfs4ExecutableName[] = "tor-obfs4-brave";

bool Initialize(const base::FilePath& install_dir) {
const auto executables = {install_dir.AppendASCII(kSnowflakeExecutableName),
Expand Down

0 comments on commit aafa710

Please sign in to comment.